Dirkjan Ochtman
816f5bd48c
Bump MSRV to 1.56
2023-05-10 11:56:29 +02:00
Paul Dicker
f6597197cd
Fix panic in from_num_days_from_ce_opt
2023-05-08 14:04:33 +02:00
Paul Dicker
a20a9b7b90
Revert "Add with_timezone to NaiveDateTime"
...
This reverts commit e9067a5a3e684f1069f9d627e57ea7d536398e2e.
2023-05-08 09:29:53 +02:00
campbellcole
e3bca27a01
add documentation for %Z quirk
2023-05-07 09:24:09 +02:00
Paul Dicker
35b145bd0c
Add #[track_caller]
to LocalResult::unwrap
2023-05-04 10:28:51 +02:00
Paul Dicker
895d3b867f
Fix warnings when running tests on Windows
2023-04-25 17:18:16 +02:00
Paul Dicker
84bbea5131
Add comment about non_exhaustive attributes
2023-04-18 17:40:49 +02:00
Paul Dicker
42943b7077
use iter::Copied (MSRV: 1.36)
2023-04-18 17:40:49 +02:00
Paul Dicker
6045377c75
Use rem_euclid from std (MSRV: 1.38)
2023-04-18 17:40:49 +02:00
Paul Dicker
93e2a91618
Add test for string slicing panic from issue 1010
2023-04-18 15:15:03 +02:00
Paul Dicker
a50648daf0
Prevent string slicing inside char boundaries
2023-04-18 15:15:03 +02:00
Paul Dicker
e9067a5a3e
Add with_timezone to NaiveDateTime
2023-04-18 12:11:01 +02:00
Paul Dicker
c83f32e6ba
Guard against overflow in NaiveDate::with_*0 methods
2023-04-18 12:09:32 +02:00
Paul Dicker
e51430f3e1
Add an example to Weekday
2023-04-18 12:00:55 +02:00
Paul Dicker
35eaac3446
Add test for issue 551
2023-04-18 11:59:25 +02:00
jtmoon79
5bc022ca81
RFC 2822 single-letter obsolete tests
...
Add follow-up tests to PR #1013
Link to RFC 2822 section.
2023-04-13 09:25:11 +02:00
Paul Dicker
5ecf30b36e
Fix military timezones in RFC 2822 parsing
2023-04-12 14:35:34 +02:00
lukas
311d52eb91
Add #[must_use] to some methods
2023-04-03 15:31:59 +02:00
Philip Munksgaard
4e2c2b4ad2
Add PartialOrd derivation for Month
...
Also add a few tests to make sure it behaves as expected.
2023-03-31 13:01:06 +02:00
Kevin
1f1e2f8ff0
Refactor windows module in Local
( #992 )
2023-03-21 10:05:16 +01:00
Dirkjan Ochtman
a6e7a3e268
Don't check serde support against our MSRV
...
serde now has a 1.56 MSRV via syn 2.
2023-03-20 13:23:58 +01:00
Môshe van der Sterre
dc9ea3ab45
fix IsoWeek so that its flags are always correct
...
This fixes #295 . PartialEq and PartialOrd are implemented by directly
comparing the internal integer field, which includes the flags value.
2023-03-16 14:08:02 +01:00
Dirkjan Ochtman
9d376499b1
Apply suggestions for clippy 1.68
2023-03-16 13:48:22 +01:00
Dirkjan Ochtman
daa86a77d3
Check benchmarks in CI
v0.4.24
2023-03-10 13:15:31 +01:00
Dirkjan Ochtman
b1e0963efc
Bump rust-cache action to v2
2023-03-10 13:15:31 +01:00
Dirkjan Ochtman
64c5d7793a
Bump version to 0.4.24
2023-03-10 13:15:31 +01:00
Tormod Gjeitnes Hellen
f5c5ac452d
Make eligible functions const.
2023-03-09 10:33:45 +01:00
Arthur Carcano
fb2f2596f5
Make iana-time-zone a target specific dependency
...
Currently, iana-tiime-zone is only used on cfg(unix). This crate,
and its windows code in particular, contains a lot of unsafe, so it
seems prudent to limit its scope to where it is actually needed.
2023-03-07 15:32:43 +01:00
Eric Sheppard
cf2a2f95f7
factor calculations to weeks_from function and add tests
...
tests for weeks_from and num_days_from
fix array iter MSRV issue
2023-03-04 12:18:21 +01:00
Eric Sheppard
8197700ccd
apply same fix to parsing and add failing test cases as per issue #961
2023-03-04 12:18:21 +01:00
raphaelroosz
a9b1ec412a
fix ordinal week calculation
...
* math is 0 based while ordinal is 1 based => fix as 1 based logic
* add extensive testing against the "date" command format
* format: test sample instead of every day
* 2007 starts with saturday
* Last day of the year is thus the 52 on Monday weekly calendar, 53 on Sunday weekly calendar.
* update %U expected value in test
* Was the goal was to have a different value than with %W at next line ? another date to pick ?
* update cfg("unix") into cfg(target_os = "linux")
* format tests/dateutils.rs
2023-03-04 12:18:21 +01:00
Léo Gaspard
f9f3c7857d
Fix panic in DateTime::checked_add_days
...
This is a backport of #941 , except it needs to work around the fact that
we can't modify the `time` crate.
2023-03-03 11:43:30 +01:00
LingMan
cd0e3b008c
chrono-fuzz: Update libfuzzer-sys dependency from 0.3 to 0.4
2023-03-03 11:42:39 +01:00
LingMan
d1043f39c8
Add chrono-fuzz to CI
...
Ensures future changes to break it again.
2023-03-03 11:42:39 +01:00
LingMan
90c7e55738
Run CI on changes to any file
...
Currently CI is only run on changes to specific files. The list of these files incomplete and would
likely get outdated again if it were expanded. Exluding specific files would be a shorter, more
stable list.
However, the changelog is only kept for posterity and the readme has seen all of two commits in the
past three years that wouldn't have triggered CI by changing other files as well, so don't bother
and just run CI for any changed file.
2023-03-03 11:42:39 +01:00
Bruce Guenter
cc64f84ac8
derive Hash
for most pub types that also derive PartialEq
2023-02-16 13:34:26 +01:00
Che
e63b7297c7
Add example of date conversion after 9999 CE
...
(cherry picked from commit 05b865deffff478facd737a540aa62d1f061acb6)
2023-02-16 10:32:29 +01:00
Che
64c4c0149d
Add (+/-) for consistency with strftime.rs
...
(cherry picked from commit a2fb1212f383e6ab59c0dec7854c173e8e63ef34)
2023-02-16 10:32:29 +01:00
c-git
366e7ea0c5
Add sign requirements for years to docs
...
(cherry picked from commit 7dfd8ca8e6b11c79a9035ba3b3ec03117e7999a9)
2023-02-16 10:32:29 +01:00
Dirkjan Ochtman
a892fcc7c2
Apply clippy suggestions for Rust 1.67
2023-02-02 09:34:54 +01:00
Kurtis Nusbaum
cbd2c1f726
point docs at non-deprecated functions
2023-02-01 09:29:38 +01:00
Greg Leonard
b244b83a64
Update deprecated methods in from_utc
example
...
`from_timestamp` and `Utc.timestamp` are deprecated, and have been replaced with `from_timestamp_opt` and `Utc.timestamp_opt` respectively, with unwrapping.
2023-01-19 11:11:02 +01:00
Dirkjan Ochtman
7c5e631fde
Apply clippy suggestions for Rust 1.66
2022-12-19 16:52:15 +01:00
Dirkjan Ochtman
a05e7aaede
Setup cargo-deny in CI
2022-12-19 16:50:30 +01:00
Dirkjan Ochtman
e02cb3e323
Skip unsound version of iana-time-zone
2022-12-19 16:50:30 +01:00
Brennan Vincent
a1591e91f3
Add from_timestamp_micros function
2022-12-15 09:46:41 +01:00
Brennan Vincent
918003e7ee
Fix MSRV violation
2022-12-14 10:28:51 +01:00
Brennan Vincent
2f14b0c870
Test that from_timestamp_millis
corresponds to from_timestamp_opt
2022-12-14 10:28:51 +01:00
Dan Dixey
5312160ce2
Fix: Typ in docstrings
2022-11-25 14:08:40 -08:00
Eric Sheppard
ff370ae656
fix bug and add more test cases
2022-11-22 22:25:25 -08:00