Fred Hebert
f8f72b7cc5
Add compile-time switch for OTP-20 string funcs
...
Allows support for Unicode data, and prevents compile warnings that will
start with OTP-20.
2017-11-01 11:26:17 -04:00
Tristan Sloughter
681973a29c
Merge pull request #118 from shopgun/master
...
Fixing #117 - microseconds not parsing when offset given
2017-09-04 19:43:46 -07:00
Warren Kenny
3ad087f8e0
Updated ISO8601 parsing to add leading zero to hour
2017-02-06 22:28:49 +00:00
Henrik Tudborg
f92f7de6f8
Fixing #117 - microseconds not parsing when offset given
2017-02-03 14:12:50 +01:00
Radek Szymczyszyn
a91c96eb92
Support ISO 8601 fractions of a seconds up to 6 places after the comma
2016-08-22 11:10:18 +02:00
Radek Szymczyszyn
5d729253d3
Add one more parsing test (just 3 places after the comma)
2016-08-19 14:09:51 +02:00
Radek Szymczyszyn
a298a7b045
Fix support for ISO 8601 fractions of a second
...
This is limited to milli- and microseconds interpreted
as 3 or 6 places after decimal comma.
All of the following, while valid according to the standard, won't be accepted:
- 2001-03-10T17:16:17.1Z
- 2001-03-10T17:16:17.12Z
- 2001-03-10T17:16:17.1234Z
- 2001-03-10T17:16:17.12345Z
- 2001-03-10T17:16:17.1234567Z
2016-08-19 12:38:40 +02:00
Radek Szymczyszyn
ed107c94b4
Fix microsecond() range
2016-08-19 11:05:29 +02:00
Kirilll Zaborsky
ab321b16e6
Testcase showing broken microseconds parsing
2016-08-19 10:32:47 +02:00
Kirilll Zaborsky
8dd9f826db
pad2 spec fix
2016-08-19 10:32:47 +02:00
Kirilll Zaborsky
d052e63ba5
Proper zero padding for microseconds
2016-08-19 10:32:47 +02:00
Eric Merritt
739a9bcf24
Swap DEV_ONLY for TEST in the test exclusion macros
2015-09-07 10:45:58 -07:00
Jordan Wilberding
ef0d252b11
Merge pull request #79 from tsloughter/master
...
18.0 Support
2015-04-23 16:16:34 -07:00
Tristan Sloughter
7015ba2951
remove use of deprecated function erlang:now/0
2015-04-23 17:56:56 -05:00
Brian Lee Yung Rowe
441d11820d
Parse Twitter-style dates
2014-12-10 10:59:24 -05:00
Jean Rouge
c25dce9689
Adding an ec_test:format_iso8601/1
fun to format datetimes according to ISO8601 standards
...
And added a couple unit tests on it.
2014-09-12 12:28:59 -07:00
Eric Merritt
16b441f0e3
fix up tests to reflect the actual NOTEST variable DEV_ONLY
2013-10-14 14:10:25 -07:00
Eric Merritt
4973a0fb8f
fix formatting problems in ec_date
2013-10-14 13:52:45 -07:00
Jesse Gumm
8bc27f62fd
Add vi modelines to files. Ignore vim backup files
2013-08-30 06:56:06 -05:00
Jesse Gumm
e984618c3e
Fix Formatting AM/PM for 12PM ({Date,{12,0,0}})
2013-04-23 17:07:52 -05:00
Jesse Gumm
4ba12ec4ad
Add disambig tests, add disambig parsing date-only
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 18:03:30 -05:00
Jesse Gumm
a2fac85ff6
Disambiguate parsing "Aug 12" and "12 Aug".
...
This started with just trying to parse the date format:
December 21st, 2013 7:00pm, which was failing with a bad_date error.
The solution involved setting up "Hinted Months", which was just a term
I used to indicate that a month was specified by name (ie "December"),
rather than by number (ie, "12"). Previously, named months were simply
replaced by their respective numbers in the parser. This tags those
named months so that the parser will unambiguously parse them correctly.
A tagged "Hinted Month" is simply a tuple with the tag `?MONTH_TAG`. For
example: "December" gets converted to `{?MONTH_TAG, 12}`
For example: "Aug 12" and "12 Aug". It's clear to the *reader* what is
meant, but when converted to simply 8 and 12, the parser has no way of
knowing which is which.
Doing this was aided with the addition of some macros to help it
along, since doing just straight comparisons with the hinted months was
yielding unexpected results. For example: `{mon, 1} > 31` returns
true, so changing that comparison to an ?is_year/1 macro that does:
`is_integer(Y) andalso Y > 31`.
It might not be a bad idea to help the parser be *very* unambiguous by
putting these macros on all comparisons.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 18:03:21 -05:00
Ben Kearns
97d39ec8db
Added support for ISO8601 Zulu and TZ time zone support. Remove hard coded version string in rebar.config.script for unit test pass. Remove dializer and edoc from default target to enable tests to run on Travis-ci
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:58:08 -05:00
Ben Kearns
4558635813
Fix broken tests.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:49:38 -05:00
Ben Kearns
122af09cb1
Added more tests and fixed format string to be 24 hour vs 12 hour.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:49:27 -05:00
Ben Kearns
5b23329d3a
Added tests and validated parse->format->parse and nparse->format->nparse
...
Conflicts:
src/ec_date.erl
2013-02-26 17:48:51 -05:00
Ben Kearns
5beeb3ff1b
Fix for dializer error.
...
Conflicts:
src/ec_date.erl
2013-02-26 17:44:31 -05:00
Ben Kearns
3437fc8c1c
Another fix for spec messages.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:43:03 -05:00
Ben Kearns
5c6af5c7f5
Added dializer fix for new date format.
...
Conflicts:
src/ec_date.erl
2013-02-26 17:42:32 -05:00
Ben Kearns
e28130d9f3
Added parsing of ISO formats i.e. "2012-12-19T12:12:12.00001"
...
Conflicts:
src/ec_date.erl
2013-02-26 17:40:13 -05:00
Ben Kearns
21c5f9fc74
Added parsing of ISO formats i.e. "2012-12-19T12:12:12.00001"
...
Signed-off-by: Eric Merritt <ericbmerritt@gmail.com>
2013-01-21 10:51:10 -08:00
Jesse Gumm
e7d175d0db
Add support for shorter times (7PM, 7AM, 7a, 7p)
2012-03-23 10:00:11 -05:00
Jesse Gumm
30184d4f77
Fix for 12am and 12pm.
...
12am should be hour 0, 12pm should be hour 12.
Signed-off-by: Eric Merritt <ericbmerritt@gmail.com>
2012-03-23 09:58:34 -05:00
Gordon Guthrie
de3f0530d6
Fix for typo.
...
Pushed up stream from choptastic's bug fix to dh_date
https://github.com/daleharvey/dh_date/pull/4
2011-12-19 11:03:27 +00:00
Eric Merritt
6d17415cdd
support US style date parsing using the same defaults from php as the original
...
Signed-off-by: Jordan Wilberding <jwilberding@gmail.com>
2011-10-17 17:39:05 -04:00
Eric Merritt
6d969cd55e
convert date parsing library from tagged return types to exceptions
...
Signed-off-by: Jordan Wilberding <jwilberding@gmail.com>
2011-10-17 17:38:58 -04:00
Eric Merritt
8898f93f61
add date parsing and formatting support from Dale Harvey
...
The original implementation was https://github.com/daleharvey/dh_date.git
Signed-off-by: Jordan Wilberding <jwilberding@gmail.com>
2011-10-16 22:26:43 -04:00