Skip to content
Browse files

update tz script; fix for inconsistent months; badLine debug tweak

A recent tzdata download contained more non-timezone files, so the
cleanup script in the README was updated to remove them.

backzone:Isle_of_Man used "March" once instead of "Mar", so instead of
fighting it, ezic_date:month_to_num/1 now parses full month names as well.

The `badLine` error related to trying to parse invalid timezone files
wasn't offering up its arguments, so it's switched to erlang:error/1
with arguments wraped in a tuple. This is to help identify which file
might be invalid.

Also, Readme has updated thank yous.
  • Loading branch information...
1 parent b292a47 commit d95e92d1dc5ac763558da52c271b8a1b76f48122 @drfloob committed Jan 6, 2015
Showing with 18 additions and 2 deletions.
  1. +3 −1 README.md
  2. +14 −0 src/ezic_date.erl
  3. +1 −1 src/ezic_loader.erl
View
4 README.md
@@ -43,7 +43,8 @@ Example Setup
# remove a few troublesome files
cd priv/tzdata
- rm *.sh *.gz *.tab factory Makefile
+ LC_COLLATE=C
+ rm *.sh *.gz *.tab factory *.pl *.awk *.list [A-Z]*
# build and run ezic
cd -
@@ -76,6 +77,7 @@ A big thanks to ezic's contributors:
* [jrgdiz](https://github.com/jrgdiz)
* [arkdro](https://github.com/arkdro)
* [amasyura](https://github.com/amasyura)
+ * [kudryashov-sv](https://github.com/kudryashov-sv)
The decision to release this into the public domain was inspired by the (anti-) license of the [SQLite project](http://www.sqlite.org/copyright.html).
View
14 src/ezic_date.erl
@@ -130,6 +130,20 @@ month_to_num("Sep") -> 9;
month_to_num("Oct") -> 10;
month_to_num("Nov") -> 11;
month_to_num("Dec") -> 12;
+
+% because backzone:Isle_of_Man used "March" once instead of "Mar"
+month_to_num("January") -> 1;
+month_to_num("February") -> 2;
+month_to_num("March") -> 3;
+month_to_num("April") -> 4;
+month_to_num("May") -> 5;
+month_to_num("June") -> 6;
+month_to_num("July") -> 7;
+month_to_num("August") -> 8;
+month_to_num("September") -> 9;
+month_to_num("October") -> 10;
+month_to_num("November") -> 11;
+month_to_num("December") -> 12;
month_to_num(X) -> erlang:error(badMonth, X).
View
2 src/ezic_loader.erl
@@ -112,7 +112,7 @@ build_record(GmtOff, Data, {"Zone", PrevName}) ->
ezic_zone:parse([PrevName,GmtOff|Data]);
build_record(Type, Data, PT) ->
- erlang:error(badLine, {Type, Data, PT}).
+ erlang:error({badLine, {Type, Data, PT}}).

0 comments on commit d95e92d

Please sign in to comment.
Something went wrong with that request. Please try again.