Compare commits
6 Commits
0.2.0
...
v0.2.4-a01
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bfb5e64e2 | |||
|
|
0fc896df64 | ||
|
|
3bfd5c35b7 | ||
|
|
498c0c566b | ||
|
|
bbcef9a45b | ||
|
|
efa43dc02e |
13
Makefile
13
Makefile
@@ -1,8 +1,15 @@
|
|||||||
|
ifdef REBAR_BARE_COMPILER_OUTPUT_DIR
|
||||||
|
EBIN = ${REBAR_BARE_COMPILER_OUTPUT_DIR}/ebin
|
||||||
|
else ifdef REBAR_BUILD_DIR
|
||||||
|
EBIN = ${REBAR_BUILD_DIR}/lib/ezic/ebin
|
||||||
|
else
|
||||||
|
EBIN = "ebin"
|
||||||
|
endif
|
||||||
|
|
||||||
zones:
|
zones:
|
||||||
wget "http://www.iana.org/time-zones/repository/tzdata-latest.tar.gz"
|
wget "https://m1.xs7.ru/time-zones/tzdata-latest.tar.gz"
|
||||||
mkdir -p priv/tzdata
|
mkdir -p priv/tzdata
|
||||||
tar -xvzf tzdata-latest.tar.gz -C priv/tzdata
|
tar -xvzf tzdata-latest.tar.gz -C priv/tzdata
|
||||||
rm tzdata-latest.tar.gz
|
rm tzdata-latest.tar.gz
|
||||||
erl -pa ebin -s ezic_generator generate -s erlang halt -noinput -noshell
|
erl -pa ${EBIN} -s ezic_generator generate -s erlang halt -noinput -noshell
|
||||||
erlc -o ebin zones/*.erl
|
erlc -o ${EBIN} zones/*.erl
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ A big thanks to ezic's contributors:
|
|||||||
* [jrgdiz](https://github.com/jrgdiz)
|
* [jrgdiz](https://github.com/jrgdiz)
|
||||||
* [arkdro](https://github.com/arkdro)
|
* [arkdro](https://github.com/arkdro)
|
||||||
* [amasyura](https://github.com/amasyura)
|
* [amasyura](https://github.com/amasyura)
|
||||||
|
* [manuel-rubio](https://github.com/manuel-rubio)
|
||||||
|
* [danielribes](https://github.com/danielribes)
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,10 @@
|
|||||||
{application,ezic,
|
{application,ezic,
|
||||||
[
|
[{registered,[]},
|
||||||
{registered, []},
|
{vsn,"0.2.3"},
|
||||||
{vsn, "0.2.0"},
|
|
||||||
{description,"A set of Erlang utilities for the Olson timezone database files"},
|
{description,"A set of Erlang utilities for the Olson timezone database files"},
|
||||||
{applications, [
|
{applications,[kernel,stdlib]},
|
||||||
kernel,
|
|
||||||
stdlib
|
|
||||||
]},
|
|
||||||
{env,[{tzdata_dir,"priv/tzdata"}]},
|
{env,[{tzdata_dir,"priv/tzdata"}]},
|
||||||
{maintainers, ["Manuel Rubio"]},
|
|
||||||
{licenses,["Public Domain"]},
|
{licenses,["Public Domain"]},
|
||||||
{links, [
|
{links,[{"Github","https://github.com/altenwald/ezic"}]},
|
||||||
{"Github", "https://github.com/altenwald/ezic"}
|
{exclude_files,["priv"]},
|
||||||
]},
|
{include_files,["Makefile"]}]}.
|
||||||
{exclude_files, []},
|
|
||||||
{include_files, ["Makefile"]}
|
|
||||||
]}.
|
|
||||||
|
|||||||
@@ -281,9 +281,19 @@ last_day_of(Day, Y,M) ->
|
|||||||
% returns a date tuple {Y,M,D} representing the first available date, given the filter
|
% returns a date tuple {Y,M,D} representing the first available date, given the filter
|
||||||
% same for all timezones
|
% same for all timezones
|
||||||
first_day_limited(Day, {geq, N}, Y,M) ->
|
first_day_limited(Day, {geq, N}, Y,M) ->
|
||||||
next_day(Day, {Y,M,N});
|
try
|
||||||
|
next_day(Day, {Y,M,N})
|
||||||
|
catch
|
||||||
|
error:no_next_day ->
|
||||||
|
next_day(Day, {Y,M+1,1})
|
||||||
|
end;
|
||||||
first_day_limited(Day, {leq, N}, Y,M) ->
|
first_day_limited(Day, {leq, N}, Y,M) ->
|
||||||
previous_day(Day, {Y,M,N}).
|
try
|
||||||
|
previous_day(Day, {Y,M,N})
|
||||||
|
catch
|
||||||
|
error:no_previous_day ->
|
||||||
|
previous_day(Day, {Y, M-1, calendar:last_day_of_the_month(Y, M-1)})
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user