Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
update tz script; fix for inconsistent months; badLine debug tweak
Browse files Browse the repository at this point in the history
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
drfloob committed Jan 6, 2015
1 parent b292a47 commit d95e92d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down Expand Up @@ -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).

Expand Down
14 changes: 14 additions & 0 deletions src/ezic_date.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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).


Expand Down
2 changes: 1 addition & 1 deletion src/ezic_loader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}).



Expand Down

0 comments on commit d95e92d

Please sign in to comment.