632 Commits

Author SHA1 Message Date
Brandon W Maister
4ae60dfb84 Add github actions config 2020-06-21 23:38:45 -04:00
Sean Loiselle
9ad1956cb1
add secs_nanos function to support total nanoseconds > max i64 in constructor (#426) 2020-06-21 10:25:22 -04:00
Brandon W Maister
ce62f917b7
Merge pull request #418 from abreis/abs_duration
Implement .abs() for Duration
2020-06-16 21:11:37 -04:00
Brandon W Maister
a10ced77f9
Merge pull request #433 from eaufavor/fix-rfc2822-comment
Fix comment: correct the comment of RFC2822 format
2020-06-16 21:09:59 -04:00
Yuchen Wu
65eebdaaaa Fix comment: correct the comment of RFC2822 format
d.day() is u32 so the padding here is '0'(%d) not ' '(%e).
2020-06-16 13:08:52 -07:00
Andre Braga Reis
ee067baddc Add the abs() methods to Duration 2020-06-16 12:20:53 +01:00
Brandon W Maister
614ec87669
Merge pull request #420 from GuillaumeGomez/patch-1
* Replace "cfg(test)" with "cfg(doctest)" for readme testing

* Add README doc checks

Co-authored-by: Brandon W Maister <quodlibetor@gmail.com>
2020-06-05 19:59:40 -04:00
Brandon W Maister
f29e0675ea
Merge pull request #417 from mwkroening/serde-option-unit
Serde: Deserialize units as None on optional value
2020-06-05 19:56:44 -04:00
Martin Kröning
49a50d9512 Adjust test for visit_unit 2020-06-06 00:49:00 +02:00
Martin Kröning
8a6d090584 Fix test (does not test visit_none) 2020-06-06 00:20:57 +02:00
Brandon W Maister
d603580b10
fix ci script syntax 2020-06-05 17:54:05 -04:00
Brandon W Maister
49b5b70764 Add a test for visiting unit 2020-06-05 17:50:00 -04:00
Guillaume Gomez
8aaa4ec824 Add README doc checks 2020-06-05 22:43:38 +02:00
Martin Kröning
404eed15e9 Serde: Remove redundant closure 2020-06-05 16:25:43 -04:00
Martin Kröning
7d7ceb4539 Serde: Deserialize units as None on optional value 2020-06-05 16:25:43 -04:00
Marc Schreiber
5a1a80fbff
Impl From variants for DateTime<Utc> and js_sys::Date (#424) 2020-06-05 16:24:22 -04:00
Xavier L'Heureux
beb2c6eefc
Update patch version of time to add Redox support (#425)
The 0.1 version of the time crates supports Redox up from version 0.1.43.
Update the dependency to allow redox to use chrono.
2020-06-05 16:22:58 -04:00
fx-kirin
bd636d811e
Fix serde with _option macro bug. (#429)
* fixing option handling.

* Add a test for serde option handling in bincode

Co-authored-by: Brandon W Maister <quodlibetor@gmail.com>
2020-06-05 16:14:49 -04:00
azarus
d4116e1257
fix docs: milliseconds -> seconds (#427) 2020-06-05 15:09:24 -04:00
Brandon W Maister
7e6b59b566
Merge pull request #428 from quodlibetor/fix-readme
Fix build
2020-06-05 15:04:09 -04:00
Brandon W Maister
b9af436698 Fix borrow rules for 1.13.0 2020-06-05 14:29:32 -04:00
Brandon W Maister
321d760d69 Fix function inclusion with serde and no other default features 2020-06-05 14:11:24 -04:00
Brandon W Maister
0ca999e1fa Fix format with format_inner
padding should only be applied after all inner formats have been built.
2020-05-27 22:49:20 -04:00
Brandon W Maister
8e1fdeaf95 Fix README generation
A previous PR updated the README instead of src/lib.rs, which should have been
caught by CI but was not.
2020-05-27 09:38:01 -04:00
Guillaume Gomez
768de26015
Replace "cfg(test)" with "cfg(doctest)" for readme testing 2020-05-07 11:54:52 +02:00
Brandon W Maister
8060089730
Merge pull request #408 from sergeyt/format_item
extract format_item function
2020-04-10 15:33:33 -04:00
Benoît Courtine
04a58593b3
Add a link to chrono_ext crate (and sources), for non ISO weeks handling (cf. issues #139 and #405). (#406) 2020-04-10 15:27:38 -04:00
Sergey Todyshev
f450ae3237 extract format_item function 2020-04-08 22:07:01 +07:00
Nathan Wilson
2b76243d36
Removed unnecessary parentheses. (#401) 2020-03-29 12:59:44 -04:00
Brandon W Maister
e493218d68
Update changelog for 0.4.11 (#399) v0.4.11 2020-03-07 16:16:02 -05:00
Brandon W Maister
725d88e0dc
Merge pull request #395 from vallentin/master
Fixed typos
2020-03-07 15:34:35 -05:00
Brandon W Maister
9041ce5b05
Merge pull request #396 from ignatenkobrain/fix-cargo-test
Fix cargo test with latest serde_json
2020-03-07 15:33:44 -05:00
Igor Gnatenko
7d37413665
Fix cargo test with latest serde_json
```rust
[  117s] error: expected item, found `"serde_json requires that either `std` (default) or `alloc` feature is enabled"`
[  117s]  --> /usr/share/cargo/registry/serde_json-1.0.48/src/features_check/error.rs:1:1
[  117s]   |
[  117s] 1 | "serde_json requires that either `std` (default) or `alloc` feature is enabled"
[  117s]   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected item
```
2020-02-18 16:57:21 +01:00
vallentin
89da02ebd5 Fixed typos 2020-02-11 21:08:21 +01:00
Brandon W Maister
4837b568c2
Merge pull request #381 from waldyrious/same-to_same-as
Reword 'same to' → 'same as'
2019-12-30 17:17:46 -05:00
Brandon W Maister
9397ab2b47
Merge pull request #375 from dlalic/354
Support comparison between dts with different timezones. Fixes #354
2019-12-30 17:16:06 -05:00
Brandon W Maister
4ad95ee602
Merge pull request #378 from quodlibetor/round-trip-display
support round tripping display <-> datetime
2019-12-30 17:15:51 -05:00
Waldir Pimenta
176dfeff87 Reword 'same to' --> 'same as' 2019-12-29 22:27:59 +00:00
Brandon W Maister
b9c967b2ac support round tripping display <-> datetime
This extends `FromStr` to allow either a `T` or a ` ` (space) as the delimiter
between the date and the time, and, because of the fact that the `Z`
parser-specifier is shared with the Fixed notation, extends the fixed notation
to support `UTC` in addition to `Z` as the zero-offset.

IMO this Fixes #147
2019-12-27 13:57:02 -05:00
Brandon W Maister
3b295ccb8f Add doctest for comparison between timestamps with different time_zones 2019-12-27 13:49:53 -05:00
Dunja Lalic
ad8644ea57 Fixes #354 2019-12-26 20:32:45 -05:00
Brandon W Maister
b9cd0ce803
Merge pull request #270 from asayers/from_ymwd
Construct a NaiveDate by specifying eg. "the 2nd Friday of March 2017"
2019-12-26 20:17:17 -05:00
Brandon W Maister
5d16648df4 rename from_ymwd -> from_weekday_of_month 2019-12-23 17:33:44 -05:00
Brandon W Maister
b5015c634b
Merge pull request #348 from gThorondorsen/test-num_days_from_ce
Test `Datelike::num_days_from_ce` against an alternative implementation
2019-12-23 17:19:43 -05:00
Brandon W Maister
d9d0728f51
Merge pull request #374 from quodlibetor/fix-playground-and-docs
Change docs and playground features so that it compiles
2019-12-23 14:16:02 -05:00
Brandon W Maister
6daed98412
Merge pull request #376 from AnderEnder/remove-deprecated-error-description
Allow deprecated Error::description and replace it with a stub implementation.
2019-12-23 13:48:56 -05:00
Brandon W Maister
536ac86511 Add bench for new implementation
Unfortunately it seems to be slightly more than twice as slow. On the plus
side, that is some justification for the existing optimizations.
2019-12-23 13:46:45 -05:00
Gwaihir Thorondorsen
3e592d4565 Test Datelike::num_days_from_ce against an alternative implementation 2019-12-23 13:28:46 -05:00
Brandon W Maister
5ca6ff5afc Make it harder to accidentally use private features
In particular if built with `--all-features` or `features = "all"` we don't
want to accidentally make it look like `YearFlags` are something that people
should use. So: hide it from docs and put it behind a dunder.
2019-12-23 13:26:05 -05:00
Brandon W Maister
4f73f9423b Make criterion a dev dependency
It's much less risky than making it an optional dependency, even if it does
mean that everyone working on chrono has to compile it.
2019-12-23 12:51:11 -05:00