1644 Commits

Author SHA1 Message Date
Paul Dicker
c21b359c88 Turn expect macro into a function 2024-03-18 11:20:43 +01:00
Paul Dicker
d91b7d4a22 Add extra assertions to NaiveDate::from_yof 2024-03-15 11:38:19 +01:00
Paul Dicker
236b7adf32 Add DateTime::with_time() 2024-03-13 14:42:18 +01:00
Paul Dicker
1789183012 Extend documentation for MappedLocalTime 2024-03-12 13:27:43 +01:00
Paul Dicker
9511dd29e6 Rename LocalResult to MappedLocalTime, add alias 2024-03-12 13:27:43 +01:00
avoidalone
920e73b033 chore: fix some typos
Signed-off-by: avoidalone <wuguangdong@outlook.com>
2024-03-11 14:05:23 +01:00
Paul Dicker
248683338d Avoid duplicate imports 2024-03-11 11:58:30 +01:00
Paul Dicker
1aabe844ed Update windows-bindgen to 0.55 2024-03-11 10:22:08 +01:00
Moritz Oberhauser
c1cb93608e Streamline test_date_checked_add_signed 2024-03-09 17:16:35 +01:00
Moritz Oberhauser
50c0e6b93c Streamline test_date_signed_duration_since 2024-03-09 17:16:35 +01:00
Moritz Oberhauser
4ac0615ddb Streamline test_date_(add/sub)_days 2024-03-09 17:16:35 +01:00
Paul Dicker
db1c8eff16 Guard against integer overflow in TzInfo::for_year 2024-03-08 14:54:48 +01:00
Paul Dicker
d40417fd1d Improve error checking in naive_date_time_from_system_time 2024-03-08 14:54:48 +01:00
Dirkjan Ochtman
bcb53864f7 Remove duplicate test 2024-03-07 10:03:43 +01:00
Erick Tryzelaar
e79fe2187d Remove unnessary Copy and Send impls
Fuchsia is doing an audit of chrono 0.4.34, and we noticed an unncessary
unsafe of `Send` for `DateTime`. While it's valid since `Tz::Offset` is
`Send`, and `NaiveDateTime` only has `u32` fields, there's a potential
hazard if `NaiveDateTime` ever grows unsendable fields (unlikely as that
is).

This (and the `Copy` impl) were added 9 years ago to fix #25, which
stemmed from early versions of associate traits not working properly
with auto-traits. This has since been fixed, and is no longer necessary
with the MSRV 1.61.0.
2024-03-07 06:55:25 +01:00
Paul Dicker
31145976e1 CI: Lint benchmarks 2024-03-06 19:36:50 +01:00
Paul Dicker
2d2f1a9670 Correct timestamp deprecation notes 2024-03-06 15:54:17 +01:00
Paul Dicker
9fdb59638e Prepare 0.4.35 v0.4.35 2024-03-06 14:25:00 +01:00
Paul Dicker
9e667b606e Deprecate panicking TimeDelta constructors 2024-03-06 14:04:55 +01:00
Paul Dicker
2c1b0bea94 Tests: replace TimeDelta::milliseconds with try_milliseconds 2024-03-06 14:04:55 +01:00
Paul Dicker
2bf3302ce5 Tests: replace TimeDelta::seconds with try_seconds 2024-03-06 14:04:55 +01:00
Paul Dicker
f93508ffd9 Tests: replace TimeDelta::minutes with try_minutes 2024-03-06 14:04:55 +01:00
Paul Dicker
9fc931a394 Tests: replace TimeDelta::hours with try_hours 2024-03-06 14:04:55 +01:00
Paul Dicker
9f23c08e10 Tests: replace TimeDelta::days with try_days 2024-03-06 14:04:55 +01:00
Paul Dicker
e8f9b5e041 Tests: replace TimeDelta::weeks with try_weeks 2024-03-06 14:04:55 +01:00
Paul Dicker
51a1aa27bd Tests: use Days type when it is more appropriate than TimeDelta 2024-03-06 14:04:55 +01:00
Paul Dicker
4251bd1eb1 Replace TimeDelta::seconds with try_seconds 2024-03-06 14:04:55 +01:00
Paul Dicker
073c3c32f0 Replace TimeDelta::days with try_days 2024-03-06 14:04:55 +01:00
Paul Dicker
383fcff56c Use simplified resolve_week_date 2024-03-06 14:04:55 +01:00
Paul Dicker
d7e5853949 Use checked_add_days in NaiveDateWeeksIterator 2024-03-06 14:04:55 +01:00
Paul Dicker
5caa640f0f Documentation fixes 2024-03-06 14:04:55 +01:00
Paul Dicker
90dbd75d0d Hide fields on Parsed in preparation of making them private with 0.5 2024-03-06 14:01:32 +01:00
Paul Dicker
ba4e50c8f2 Add getters to Parsed 2024-03-06 14:01:32 +01:00
Paul Dicker
40724008b2 Add range checks to the Parsed::set_* methods 2024-03-06 14:01:32 +01:00
dependabot[bot]
f4adc28dce Update windows-bindgen requirement from 0.53 to 0.54
Updates the requirements on [windows-bindgen](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.53.0...0.54.0)

---
updated-dependencies:
- dependency-name: windows-bindgen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 07:34:48 +01:00
Paul Dicker
0aa46ddbf0 Sync Datelike docs 2024-03-01 11:52:26 +01:00
Paul Dicker
1d3da21ae2 Add comment to calculate UNIX_EPOCH_DAY 2024-03-01 11:52:09 +01:00
Paul Dicker
83573a8b30 Deprecate timestamp methods on NaiveDateTime 2024-03-01 11:52:09 +01:00
Paul Dicker
585d48be38 Don't use timestamp methods from NaiveDateTime in serde module 2024-03-01 11:52:09 +01:00
Paul Dicker
392e0dd460 Don't use timestamp methods from NaiveDateTime 2024-03-01 11:52:09 +01:00
Paul Dicker
39f9a97b9b Translate timestamp tests to DateTime 2024-03-01 11:52:09 +01:00
Paul Dicker
27a1ee4cdc Move implementation of from_timestamp* to DateTime 2024-03-01 11:52:09 +01:00
Paul Dicker
0c23fd4df5 Move implementation of timestamp* to DateTime 2024-03-01 11:52:09 +01:00
Paul Dicker
1c1feca6fa Use UNIX_EPOCH in NaiveDateTime::default() 2024-03-01 11:52:09 +01:00
Paul Dicker
774951ff3d Add DateTime::{from_timestamp_micros, from_timestamp_nanos} 2024-03-01 11:52:09 +01:00
Paul Dicker
ca51f694bb Make with_year return Some if it is a no-op 2024-02-29 13:16:43 +01:00
Paul Dicker
43675f162c Use overflowing_naive_local in checked_(add|sub)_days 2024-02-29 13:16:43 +01:00
Paul Dicker
06bd82cccf Extend fast path in NaiveDate::add_days 2024-02-29 13:16:43 +01:00
Paul Dicker
dd201649b5 Use overflowing_naive_local in checked_(add|sub)_months 2024-02-29 13:16:43 +01:00
Paul Dicker
e292d9bc90 Simplify from_isoywd a bit 2024-02-27 16:04:18 +01:00