Commit Graph

21 Commits

Author SHA1 Message Date
Kang Seonghoon d50546a592 More documentation for NaiveTime, and addition fixes.
While writing documentation tests for NaiveTime it was found that
the addition involving leap seconds is *still* slightly broken.
(A consequence of having less tests, well.) The addition routine
has been rewritten to be explicit about leap seconds while passing
all other tests, so the rewrite does not change the intention.
2016-08-06 19:32:01 +09:00
Kang Seonghoon 00858c6363 More cross-references. 2016-08-02 20:52:45 +09:00
Kang Seonghoon 66d5856354 Fixed `%.[369]f` on the whole seconds and misleading docs.
Fixes #71.
2016-04-22 00:47:01 +09:00
Tom Gallacher 7b31609418 Adding fixed precision for Nanosecond3, 6 and 9 2015-09-03 13:40:34 +01:00
Kang Seonghoon 1f40b03ab9 new formatting specifiers to `strftime` syntax.
- Padding modifiers `%_?`, `%-?` and `%0?` are implemented.
  They are glibc extensions which seem to be reasonably widespread
  (e.g. Ruby).

- Added `%:z` specifier and corresponding formatting items
  which is essentially same to `%z` but with a colon.

- Added a new specifier `%.f` which precision adapts from the input.
  Also clearly documented the differences between `%f` and `%.f`. (#40)
2015-07-05 15:00:11 +09:00
Kang Seonghoon 0466a4bf30 documentation fix and some slight bug fix.
- The time zone offset is printed without a colon, but the documentation
  had that inverted. (#39)

- `chrono::format::strftime`'s specifier table is tested throughly.

- When `%s` specifier is used with a time zone, the time zone offset was
  ignored. This has been fixed.
2015-05-29 02:26:01 +09:00
Kang Seonghoon 04b179502c 0.2.5: language changes, mostly overflow changes. 2015-03-06 00:23:51 +09:00
Dan d85ca7564f Remove old closure kind syntax 2015-03-02 11:50:03 +00:00
Kang Seonghoon c11b6deb5a 0.2.1: language changes.
- `std::hash` has been renewed.

- `DelayedFormat` no longer has a redundant lifetime.
2015-02-21 18:15:11 +09:00
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