Commit Graph

12 Commits

Author SHA1 Message Date
Kang Seonghoon 30322bbc89 added `parse_from_rfc{2822,3339}`/`to_rfc{2822,3339}` methods to DateTime. 2015-02-19 04:57:21 +09:00
Kang Seonghoon e997403c10 `num_seconds_from_unix_epoch` is gone, long live `timestamp`!
this is partly because... we are using the simple name `timestamp`
in the `Parsed` anyway. that value is so widespread enough that
its name can be simply THE timestamp. old methods have been marked
deprecated.
2015-02-19 02:45:29 +09:00
Kang Seonghoon 76b0873722 added `FromStr` impls to naive date and time types.
also, previously `Numeric::Nanosecond` had a special left-aligned
parsing behavior. this commit replaces that with a newly designated
`Fixed::Nanosecond` which also handles an empty string which is
possible with an integral number of seconds.
2015-02-18 23:27:12 +09:00
Kang Seonghoon ca865e3c24 added more tests for non-four-digit years and fixed edge cases. 2015-02-18 00:00:30 +09:00
Kang Seonghoon 0399ba1849 weakened the non-negative requirement of year/isoyear fields.
accepts ISO 8601-ish `+YYYYY` or `-YYYYY` notations. this is needed
for the bijectivity of `to_string` and an upcoming `from_str`.
2015-02-17 22:18:39 +09:00
Kang Seonghoon 6937470405 created `format::parse` module.
this new module encompasses John Nagle's original RFC 2822 and 3337
parsers, updated to fully compatible to the actual standard.
the contributed `parse` module has been merged into it.
2015-02-15 21:02:44 +09:00
Kang Seonghoon 25b8e21d29 separated a `format::scan` module from the parser.
also changes the behavior of `Numeric::Nanosecond` (`%f`) to
the left-aligned digits and allows for the wider range of time zone
offsets from -99:59 to +99:59.
2015-02-13 18:46:02 +09:00
Kang Seonghoon 7eb9a1a983 public interfaces for parser are now available. 2015-02-05 02:16:35 +09:00
Kang Seonghoon 9768b57494 reworked new `format` APIs to return a proper Result and error code. 2015-02-05 00:54:25 +09:00
Kang Seonghoon aebcedf37b added `format::parse` and accompanying tests. 2015-02-04 16:31:37 +09:00
Kang Seonghoon 02b4c72f22 initial `format::parsed` implementation. 2015-02-04 16:22:41 +09:00
Kang Seonghoon 43ee68b522 new formatter design!
- Format string is internally represented as a series of formatting
  items. Items can be directly given to now-public `format::format`
  function as well.

- Format string parser is separated to `format::strftime` module.
  This is to allow for potentional alternative formatting syntaxes.

- `DelayedFormat` now receives an iterator for formatting items.
2015-02-04 16:19:54 +09:00