1430 Commits

Author SHA1 Message Date
Paul Dicker
02a96eba57 Remove workaround for Rust < 1.61 2024-01-29 09:31:44 +01:00
Paul Dicker
baa55d0847 CI: test arbitrary feature 2024-01-26 15:55:32 +01:00
Paul Dicker
f3e56c505d Arbitrary does not (yet) support no_std 2024-01-26 15:55:32 +01:00
Paul Dicker
76822ae051 Don't use deprecated method in impl Arbitrary for DateTime 2024-01-26 15:55:32 +01:00
Paul Dicker
ec557d2843 Specify branch for GitHub Actions badge and fix link 2024-01-26 15:15:50 +01:00
Dirkjan Ochtman
5cbb9a7d9c Update branch names in pull request template 2024-01-26 14:53:31 +01:00
Eden Mikitas
94f9738b03 Fix the formatting of timestamp_micros's Example doc 2024-01-26 10:42:48 +01:00
Paul Dicker
7c419a358e Prepare 0.4.33 release v0.4.33 2024-01-25 13:32:46 +01:00
Paul Dicker
a9b37c4c81 Make rkyv feature default to size_32 2024-01-25 13:32:46 +01:00
Paul Dicker
a73b54320a Don't assume rkyv-(16|32|64) implies the rkyv feature 2024-01-25 13:32:46 +01:00
Dan Williams
b5381f8fb5 Fixed typo in Duration::hours() exception 2024-01-25 09:48:03 +01:00
Kenny Kerr
bf704191f2 52 v0.4.32 2024-01-22 23:04:19 +01:00
Dirkjan Ochtman
7757386368 Prepare 0.4.32 release 2024-01-22 22:21:52 +01:00
Tam Pham
cee242a656 Fix typos in Datelike impl for DateTime 2024-01-18 19:07:06 +01:00
Makro
6ec8f97d16
Add from_timestamp_millis to DateTime<Utc> (#1374)
Co-authored-by: xmakro <makro@>
2024-01-09 17:50:58 +01:00
gibbz00
65f0cc2aa4 CI Linting: Fix missing sources checkout in toml job. 2024-01-09 17:47:35 +01:00
Dan Williams
5536687c0d
Add Months::as_u32() (#1373) 2024-01-09 13:24:41 +01:00
Thayne McCombs
6033afea6f docs: Improve deprecation of TimeZone::datetime_from_str
Add recommending using `NaiveDate::parse_from_str` as well
2024-01-04 15:49:11 +01:00
Gerd Zellweger
849932b09b Change the CI --all-features to an explicit list.
This is due to the mutually exclusive features in rkyv which
we expose now. `--all-features` will now activate them and the crate
will fail to compile rkyv. We work around this by defining
an explicit list of all mutually exclusive features to.

Unfortunately there isn't an easy way to share env variables
among different YAML files
(https://github.com/actions/runner/issues/655).

There also isn't a good way to specify `--all-features` minus
"just a few" (https://github.com/rust-lang/cargo/issues/3126)
aside from giving the complete list.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
2023-12-29 09:51:40 +01:00
Gerd Zellweger
3f22822086 Expose rkyv features as features for chrono users.
rkyv by default serializes usize as u32. This isn't ideal
on most modern platforms and unfortunately is configured through
a feature flag.

If we just set `default-features = false` in the rkyv Cargo
dependency, the crate fails to compile because all the size features
are mutually exclusive. On the other hand if we want to
e.g., change the serialization of usize to 64-bit and
we also want to use chrono this currently fails to compile
because chrono always enables rkyv/size_32.

This re-exports the relevant rkyv features so users can
choose which serialization to enable. The approach
is similar to what the ordered-float crate does:

8111b34537/Cargo.toml (L37)

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
2023-12-29 09:51:40 +01:00
Dirkjan Ochtman
d7b4a82027 Silence clippy lint for test code 2023-11-27 13:05:40 +01:00
Ali Mirghasemi
e1a9494e24
Add from_timestamp_nanos (#1357)
* Add from_timestamp_nanos

Add and implement from_timestamp_nanos and add unit test for it

* Fix lint check error

* Add pub(crate) for NANOS_PER_SEC

* Replace number with constant variable
2023-11-24 09:38:25 +01:00
dcechano
6f3ab9dd5a Add From<NaiveDate> for NaiveDateTime 2023-11-20 11:52:05 +01:00
dependabot[bot]
039189c4a1 Update windows-targets requirement from 0.48 to 0.52
Updates the requirements on [windows-targets](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/windows-targets-0.48.1...0.52.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:34:35 +01:00
Matt Mastracci
c0f418bbbf Split clock feature into clock and now 2023-11-08 15:48:17 +01:00
Dirkjan Ochtman
dd3f2f81c4 Bump MSRV to 1.61 2023-11-07 11:17:45 +01:00
jtmoon79
fbd67ab02c test.yml remove errant with: node-version 2023-11-06 09:27:29 +01:00
dependabot[bot]
15c8885365 Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:40:46 +01:00
Mikhail Katychev
02bdd1ddc8
archive derive of PartialEq for rkyv - 0.4.x (#959) 2023-10-10 16:25:06 +02:00
Paul Dicker
0f19d6be1d Adjust Duration::MIN by 1 millisecond 2023-09-29 13:42:20 +02:00
Paul Dicker
fe4713a4f0 Make NaiveDateTime::and_utc const 2023-09-29 11:14:06 +02:00
Paul Dicker
a0d3800412 (Used in NaiveDate::timestamp*)
Make methods on `NaiveDateTime` const where possible
2023-09-29 11:14:06 +02:00
Paul Dicker
c8e3eb4ce1 Implement AddAssign and SubAssign 2023-09-29 10:50:41 +02:00
Paul Dicker
bd6573aebe Use checked_add and checked_sub in Add and Sub impls 2023-09-29 10:50:41 +02:00
Léo Gaspard
a2820c4f7d Add Duration::try_* builders 2023-09-29 10:50:41 +02:00
Paul Dicker
8018c32684 Rename Duration::nanos_mod_sec to subsec_nanos, make public 2023-09-29 10:50:41 +02:00
Paul Dicker
6d3a77dc5a Derive Default for Duration. 2023-09-29 10:50:41 +02:00
Paul Dicker
4bbfa9ffe1 Fix quotes in docs.rs feature list 2023-09-29 10:50:14 +02:00
Paul Dicker
bb4e9b0358 Remove unnecessary feature gate 2023-09-28 17:56:07 +02:00
Paul Dicker
604b92a241 Convert manual documentation links 2023-09-27 12:31:30 +02:00
Paul Dicker
b7857baed2 Move SecondsFormat from datetime to format::formatting 2023-09-27 12:31:30 +02:00
Paul Dicker
5237de6e0a Make round module public
(so we don't need to show it in the main documentation)
2023-09-27 12:31:30 +02:00
Paul Dicker
819dea0480 Local does not depend on the time crate 2023-09-27 12:31:30 +02:00
Paul Dicker
5da23657cc Hide private macros 2023-09-27 12:31:30 +02:00
Paul Dicker
017b621033 Remove useless #[doc(no_inline)] from prelude module 2023-09-27 12:31:30 +02:00
Paul Dicker
295e9c8321 Tweaks to visibility in main documentation 2023-09-27 12:31:30 +02:00
Paul Dicker
22846c9df1 Inline write_rfc2822_inner, don't localize 2023-09-27 11:10:36 +02:00
Paul Dicker
e28f2afa70 Use overflowing_naive_local in map_local
This fixes out-of-range panics in all the `with_*` methods that use `map_local`.
2023-09-27 11:09:20 +02:00
Paul Dicker
e6580db095 Use overflowing_naive_local in methods that don't return DateTime 2023-09-27 11:09:20 +02:00
Paul Dicker
4ca5a5292f Add overflowing_naive_local and NaiveDateTime::overflowing_add_offset 2023-09-27 11:09:20 +02:00