676 Commits

Author SHA1 Message Date
Brandon W Maister
8d66a68e47
Merge pull request #461 from chronotope/pr-353
Add a public Month enum
2020-07-27 10:05:49 -04:00
Brandon W Maister
0579d2af08
Document the features available to chrono users (#460) 2020-07-24 20:28:18 -04:00
Brandon W Maister
135e86ecd0 Make compatible with no_std 2020-07-24 14:43:12 -04:00
hhamana
143c802822 include in prelude 2020-07-24 14:43:12 -04:00
hhamana
cf973ccde3 fix doctest 2020-07-24 14:43:12 -04:00
hhamana
38810a33bf Adds a public Month enum.
Implementation for a Month enum, allowing -ser|de-rialization.
The implementation mostly mirrors the Weekday enum.
It only adds the enum with minimal integration so as to
not cause any backwards compatibility issue.
A deeper integration should be up to discussion.
Suggested in Issue #202
2020-07-24 14:43:12 -04:00
Brandon W Maister
53e63c3709
Merge pull request #457 from robyoung/pr/209
Add days and weeks iterators for `NaiveDate`
2020-07-24 13:32:18 -04:00
Rob Young
bfddc1e5fa Update CHANGELOG for day and week iterators 2020-07-24 13:11:13 -04:00
Rob Young
41345f10a1 Add weeks iterator for NaiveDate 2020-07-24 13:11:13 -04:00
gnzlbg
355052ba4a Add a days iterator for NaiveDay 2020-07-24 13:11:13 -04:00
Rob Young
6b600e83e8
Allow manual-non-exhaustive (#458)
It is needed as the non_exhaustive attribute is not available on 1.13.0.

This should fix the broken linting.
2020-07-24 12:21:12 -04:00
Brandon W Maister
130253ef2b
Support testing on both main and master (#454) 2020-07-11 13:56:02 -04:00
Rob Young
aaee912228
Add MIN and MAX DateTime, Time and NaiveDateTime (#452)
Resolves #386
2020-07-10 17:32:19 -04:00
Brandon W Maister
a905c556d8
Add unreleased section to changelog (#448) 2020-07-06 08:53:58 -04:00
Brandon W Maister
2b5437ded0
Merge pull request #447 from quodlibetor/rel-v0.4.13
Release v0.4.13
v0.4.13
2020-07-05 18:58:12 -04:00
Brandon W Maister
13c2f0bfc2 Pin version of shellcheck
0.4.0 caused https://github.com/ludeeus/action-shellcheck/issues/21
2020-07-05 18:56:17 -04:00
Brandon W Maister
cc0e795b59 Release v0.4.13 2020-07-05 18:50:00 -04:00
Brandon W Maister
6be7be37fc
Merge pull request #446 from schrieveslaach/feature/js-sys-date-improvements
Improve From<js_sys::Date> Variants for DateTime<Utc>
2020-07-05 18:34:27 -04:00
Brandon W Maister
073d86a3b1 Simplify math, add a js_sys test for correctness 2020-07-05 16:50:58 -04:00
Brandon W Maister
b6d7bac99a Fix wasm testing
wasm-bindgen-test and wasm-bindgen need to be different versions (0.3 and 0.2,
respectively), otherwise no tests are found([1], [2]);

This also fixes the test to and ci runner to just test in the current env/tz,
thereby requiring that js_sys returns the same timezone as the host system
thinks it is, but not otherwise trying to set the TZ.

[1]: https://users.rust-lang.org/t/wasm-bindgen-test-and-no-tests-to-run/43444
[2]: https://github.com/rustwasm/wasm-bindgen/pull/2123
2020-07-05 16:50:58 -04:00
Marc Schreiber
545fd9f863 Improve From<js_sys::Date> Variants for DateTime<Utc> 2020-07-05 16:50:57 -04:00
Rob Young
4348cd13c7
Add rounding and truncating by Duration (#445)
Resolves #280
2020-07-05 14:06:11 -04:00
Brandon W Maister
e90050c852
Prepare changelog for next release (#444) 2020-07-01 21:56:41 -04:00
Brandon W Maister
cc943c9650
Only run tests when rust files have changed (#443) 2020-07-01 18:27:38 -04:00
Brandon W Maister
311659f2cc
Release v0.4.12 (#442) v0.4.12 2020-07-01 18:21:04 -04:00
Brandon W Maister
ea2d2da905
Remove oldtime::Duration::seconds_nanos (#441)
It causes a different _increased_ API when features are _disabled_.

It'll be re-added when #286 is finished
2020-07-01 18:08:15 -04:00
Brandon W Maister
8bc94d5281
Use js runtime for Local offset in js environment (#412)
Possible fix for #411
2020-06-29 19:02:24 -04:00
Brandon W Maister
0e0178adfe
Merge pull request #439 from quodlibetor/lint-alot
Lint things: clippy and rustfmt
2020-06-29 18:49:00 -04:00
Brandon W Maister
e4a6f3e830 wasm-pack appears to segfault occasionally on ubuntu
See this for example, where it segfaulted on `--version`:

https://github.com/chronotope/chrono/pull/412/checks?check_run_id=814649507

Probably the same thing as https://github.com/rustwasm/wasm-pack/issues/823
2020-06-27 17:25:38 -04:00
Brandon W Maister
c788a4495b Add a lint for cargo fmt
This also adds the cargo fmt commit to the (new) .git-ignore-revs file which
can cause it to not show up in `git blame` either with `--ignore-revs-file` or
`git config blame.ignoreRevsFile .git-ignore-revs`
2020-06-27 17:10:38 -04:00
Brandon W Maister
febb8dc168 rustfmt everything 2020-06-27 17:04:22 -04:00
Brandon W Maister
e0412b7813 Enable clippy lints and deny all warnings 2020-06-27 16:55:15 -04:00
Brandon W Maister
77ade72ec8 clippy: match_ref_pats 2020-06-27 16:55:15 -04:00
Brandon W Maister
991a8c1bd8
Add a pull-request template (#438) 2020-06-27 16:10:10 -04:00
Brandon W Maister
b98c0cf62c
Update changelog to include changes since last release (#435) 2020-06-27 16:09:40 -04:00
Brandon W Maister
bdc58a8ac1
Merge pull request #436 from quodlibetor/github-actions
Migrate to github actions from travis + appveyor
2020-06-27 15:41:40 -04:00
Brandon W Maister
c2fe38cd84 clean up github workflows ui
This puts different kinds of tests in different job names, instead of
shoehorning them into the matrix.
2020-06-27 15:25:17 -04:00
Brandon W Maister
43db62eda3 Get rid of appveyor and travis configs 2020-06-26 12:37:57 -04:00
Brandon W Maister
ad2461062f Deal with time not working on windows with rust 1.13 2020-06-21 23:55:41 -04:00
Brandon W Maister
ee6447c8c2 windows has lower system time granularity than unix 2020-06-21 23:55:41 -04:00
Brandon W Maister
bc66f2aa48 remove unnecessary paren 2020-06-21 23:55:41 -04:00
Brandon W Maister
2e11b5949c remove unused imports 2020-06-21 23:55:41 -04:00
Brandon W Maister
9ccc65aeda Fix oldtime, make it more clear what's going on 2020-06-21 23:55:41 -04:00
Brandon W Maister
2c81fa8c1a clean up clippy lints 2020-06-21 23:55:41 -04:00
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