commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
aa361bbfc2c330deb548ff903b61c8e1abcc4887
Andrew Gallant
2025-11-09T12:58:44
fmt: un-generic a function This reduces code size somewhat. There are probably more things like this, but I picked this one to test its effects. It got rid of a few LLVM lines from an LTO-compiled binary that uses Jiff. But not much.
diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs index b3d5bd6..f61bf4c 100644 --- a/src/fmt/friendly/printer.rs +++ b/src/fmt/friendly/printer.rs @@ -1223,19 +1223,19 @@ impl SpanPrinter { ) -> Result<(), Error> { let span = span.abs(); if span.get_years() != 0 { - ...
1
19
15
34359896a4e2df02269256ccd255a1bb89093068
Andrew Gallant
2025-12-12T22:35:45
fuzz: update dependencies
diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index f2c0ea0..5e5046c 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -4,34 +4,60 @@ version = 4 [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b...
1
74
85
f889e5b40a68588e4c28f99ae9569e78620337f3
Andrew Gallant
2025-12-11T01:44:39
jiff-tzdb-0.1.5
diff --git a/crates/jiff-tzdb/Cargo.toml b/crates/jiff-tzdb/Cargo.toml index 3374467..7330144 100644 --- a/crates/jiff-tzdb/Cargo.toml +++ b/crates/jiff-tzdb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-tzdb" -version = "0.1.4" #:version +version = "0.1.5" #:version authors = ["Andrew Gallant <jamslam@gmail.c...
1
1
1
6bab68dc24df7cea36d17099178e8ed25d24c356
Andrew Gallant
2025-11-07T13:22:47
jiff-icu-0.2.2
diff --git a/crates/jiff-icu/Cargo.toml b/crates/jiff-icu/Cargo.toml index b4b90ff..510cdab 100644 --- a/crates/jiff-icu/Cargo.toml +++ b/crates/jiff-icu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-icu" -version = "0.2.1" #:version +version = "0.2.2" #:version authors = ["Andrew Gallant <jamslam@gmail.com>"]...
1
1
1
422353bb0c7aa8e481d34e1e8fce6066ab35fb4d
Andrew Gallant
2025-11-07T13:14:23
jiff-icu: add `TryFrom` impls for `icu_time::zone::models::AtTime` It looks like `icu_time::zone::models::Full` has been deprecated. So we need some `allow(deprecated)` to squash the warnings. And we implement a `TryFrom` for `ZonedDateTime<Iso, TimeZoneInfo<AtTime>>` as its replacement. Previously, I think this woul...
diff --git a/crates/jiff-icu/src/lib.rs b/crates/jiff-icu/src/lib.rs index 368f4ec..a4b6169 100644 --- a/crates/jiff-icu/src/lib.rs +++ b/crates/jiff-icu/src/lib.rs @@ -37,7 +37,7 @@ emit the time zone information, we need to add a zone marker to our fieldset: ``` use icu::{ calendar::Iso, - time::ZonedDateTi...
1
56
4
ba1de61e1bc93fa64f17d7d0a2636382f1c88293
Andrew Gallant
2025-11-07T12:54:58
jiff-icu-0.2.1
diff --git a/crates/jiff-icu/Cargo.toml b/crates/jiff-icu/Cargo.toml index 925d128..b4b90ff 100644 --- a/crates/jiff-icu/Cargo.toml +++ b/crates/jiff-icu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-icu" -version = "0.2.0" #:version +version = "0.2.1" #:version authors = ["Andrew Gallant <jamslam@gmail.com>"]...
1
1
1
0b293b416dbdc5d4336595a04333de2f573040c8
Andrew Gallant
2025-11-07T12:50:44
doc: a few documentation fixes
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index 702a4e9..9455dd0 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -624,7 +624,7 @@ impl<C> Config<C> { /// This trait currently does not support parsing based on locale in any way. /// /// This trait also does not support locale sp...
2
6
6
b9484eaa48f4b046f69444cd9503c28e4fa8b467
Abdulrazaq Alhendi
2025-11-01T18:35:12
fmt/serde: add helpers for `std::time::Duration` This commit writes out the Serde helpers for unsigned durations. This is the pay off for adding the dedicated parsers/printers for a `std::time::Duration`. Previously, we were converting to/from a `SignedDuration`, which fundamentally limited the range of values we cou...
diff --git a/src/fmt/serde.rs b/src/fmt/serde.rs index 510dbce..dc0078f 100644 --- a/src/fmt/serde.rs +++ b/src/fmt/serde.rs @@ -39,6 +39,13 @@ easy copy & paste. * [`tz`] * [`jiff::fmt::serde::tz::required`](self::tz::required) * [`jiff::fmt::serde::tz::optional`](self::tz::optional) +* [`unsigned_duration`...
1
580
7
87c607bb728c9a049a1e342543b6b151706f6e2a
Andrew Gallant
2025-11-06T20:07:43
fmt: add parsing routines for `std::time::Duration` This was a little hairier than printing, but still overall pretty easy given my previous changes!
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 549603e..9132c2d 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -243,7 +243,7 @@ impl SpanParser { ) -> Result<SignedDuration, Error> { let mut builder = DurationUnits::default(); l...
5
711
23
8a7f2492fd86854fe5c9f11b56a3e4a387a9bf61
Andrew Gallant
2025-11-06T16:05:29
fmt: add support for printing `std::time::Duration` This was thankfully as straight-forward as I was hoping!
diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs index 9f6cc56..b3d5bd6 100644 --- a/src/fmt/friendly/printer.rs +++ b/src/fmt/friendly/printer.rs @@ -1035,6 +1035,49 @@ impl SpanPrinter { buf } + /// Format a `std::time::Duration` into a string using the "friendly" + /// for...
3
1,038
91
3e49cbed788c271a4dbb81f81254250615cd42d8
Andrew Gallant
2025-11-06T20:37:17
signed_duration: remove extraneous comments
diff --git a/src/signed_duration.rs b/src/signed_duration.rs index a903098..f70f1ab 100644 --- a/src/signed_duration.rs +++ b/src/signed_duration.rs @@ -2210,7 +2210,6 @@ impl SignedDuration { const MIN_HOUR: i64 = i64::MIN / (SECS_PER_MINUTE * MINS_PER_HOUR); // OK because (SECS_PER_MINUTE*MINS_PER_H...
1
0
2
b5f30f2324d9249e45871f0df4d52ec94db1a76d
Andrew Gallant
2025-11-01T18:35:26
fmt: make fractional formatting use `u32` I think when I originally wrote fractional formatting, I was thinking about using precision values greater than `9`. But that never really panned out. And I used signed values because I used signed values everywhere. I think this is the last change we need to be able to feasi...
diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs index 5f2caba..9f6cc56 100644 --- a/src/fmt/friendly/printer.rs +++ b/src/fmt/friendly/printer.rs @@ -1621,7 +1621,7 @@ impl<'p, 'w, W: Write> DesignatorWriter<'p, 'w, W> { /// formatter for the fractional component. struct FractionalPrinter { ...
6
37
29
8e61ffd5e2a6c7bee596a6ba51dc6515195659e3
Andrew Gallant
2025-11-01T18:35:25
fmt: add unsigned integer formatting ... so that we can print `u64` values as-is without suspicious casts. Unsigned integer printing is also simpler, so it's plausible that it's faster too. Although I haven't been careful about benchmarking duration printing. In the next commit, we will finish removing the casts by t...
diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs index 17c0ba3..5f2caba 100644 --- a/src/fmt/friendly/printer.rs +++ b/src/fmt/friendly/printer.rs @@ -1140,34 +1140,43 @@ impl SpanPrinter { ) -> Result<(), Error> { let span = span.abs(); if span.get_years() != 0 { - ...
3
137
65
191006379b01242a6ae4e30deee3ab1ad4365e1a
Andrew Gallant
2025-11-01T18:35:24
fmt: refactor friendly printer to use `std::time::Duration` This is continued progress toward natively supporting `std::time::Duration`. I basically didn't want to duplicate all of the code used to print a `SignedDuration` just so that we could print a `std::time::Duration`. Since we handle the sign before/after most ...
diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs index 4464f7e..17c0ba3 100644 --- a/src/fmt/friendly/printer.rs +++ b/src/fmt/friendly/printer.rs @@ -6,15 +6,15 @@ use crate::{ Error, SignedDuration, Span, Unit, }; -const SECS_PER_HOUR: i64 = MINS_PER_HOUR * SECS_PER_MIN; -const SECS_PER_...
1
130
105
9b46e2e0c16f1221b7af41e547887c5a3ab1c0d8
Andrew Gallant
2025-11-01T18:35:24
fmt: optimize parsing into `Span` We do something similar like we did for `SignedDuration`: we carve out a fast path that generally lets us quickly skip error checking and what not. Overall comparison with current `master` (211a36d5ecddf1aeb9b00648d9d5e631a5420903): group ...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 1d38302..549603e 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -776,7 +776,7 @@ mod tests { // the maximum number of microseconds is subtracted off, and we're // left over with a value that...
3
263
82
1cb039f7076caafc804b5fe36825893863ad1827
Andrew Gallant
2025-11-01T18:35:23
fmt: fix `i64::MIN` bug in ISO 8601 duration parsing This only applies to parsing into a `SignedDuration` since `i64::MIN` isn't supported by any units on `Span` (including nanoseconds, since it only supports `(i64::MIN+1)..=i64::MAX` to make negations infallible). We pull out the u64 prefix parser from the friendly ...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 7ab034f..1d38302 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -5,7 +5,7 @@ use crate::{ util::{parse_temporal_fraction, DurationUnits}, Parsed, }, - util::{c::Sign, escape}, + util::{c:...
3
60
78
206f08100da309d44feb4b4c37e231a0c0aef717
Andrew Gallant
2025-11-01T18:35:22
fmt: more clean up This DRY's up some code and tightens up a few things.
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 4226ee3..7ab034f 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -177,21 +177,23 @@ impl SpanParser { /// /// # Ok::<(), Box<dyn std::error::Error>>(()) /// ``` + #[inline] pub fn parse_span<I: ...
5
159
375
8f75807b5e113110601523972cd5c0fa100466cd
Andrew Gallant
2025-11-01T18:35:22
fmt: optimize parsing `SignedDuration` The "before" here reflects `master` (`211a36d5ecddf1aeb9b00648d9d5e631a5420903`) and not the previous commit: group master new ----- ------ ...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 261b012..4226ee3 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -276,8 +276,10 @@ impl SpanParser { optional sign, but no integer was found", )); }; - let Parsed { value...
3
107
29
da7a745635187c5fb854e01dc2322473d0eae47f
Andrew Gallant
2025-11-01T18:35:20
zoned: fix copy & paste transcription error
diff --git a/src/zoned.rs b/src/zoned.rs index 54bc0b1..8f37e78 100644 --- a/src/zoned.rs +++ b/src/zoned.rs @@ -517,8 +517,8 @@ impl Zoned { Zoned { inner } } - /// Create a builder for constructing a new `DateTime` from the fields of - /// this datetime. + /// Create a builder for constructin...
1
2
2
53db0d137eeefb33bd6cbd115f33581c22b46013
Andrew Gallant
2025-11-01T18:35:20
fmt: remove another ranged integer Specifically, the ranged integer used when parsing fractional values. We'll want to do this in order to switch over to parsing durations into a single shared unified type.
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 878a25f..f8c6064 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -868,7 +868,7 @@ struct HMS { hour: i64, minute: i64, second: i64, - fraction: Option<t::SubsecNanosecond>, + fraction: Option<i32>...
4
20
24
729374ba204b6af751a302b5f250980062acb062
Andrew Gallant
2025-11-01T18:35:19
fmt: slight simplification This lets me un-export `Decimal::new`. A small matter.
diff --git a/src/fmt/mod.rs b/src/fmt/mod.rs index dce32c9..1412a7f 100644 --- a/src/fmt/mod.rs +++ b/src/fmt/mod.rs @@ -399,7 +399,7 @@ trait WriteExt: Write { formatter: &DecimalFormatter, n: impl Into<i64>, ) -> Result<(), Error> { - self.write_decimal(&Decimal::new(formatter, n.into())...
2
4
7
00e630b76f1983f1f773cdc83ccae7e42efbdc85
Andrew Gallant
2025-11-01T18:35:18
fmt: rip out some uses of ranged integers In particular, `NoUnits` and `NoUnits128`. I dare say that this might be (the very) beginning of getting away from ranged integers. The specific motivation here is that we want to be able to parse `std::time::Duration`. And to do that, we need to be able to parse a `u64`. But...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index fa14daa..878a25f 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -346,7 +346,7 @@ impl SpanParser { fn parse_units_to_span<'i>( &self, mut input: &'i [u8], - first_unit_value: t::NoUnits,...
4
113
125
61e329d7f0269029422731f6779d24a354a4bda7
Andrew Gallant
2025-11-01T18:35:17
signed_duration: add `i128` constructors ... and also a smattering of internal helpers. The `SignedDuration::from_nanos_i128` constructor in particular is analogous to `std::time::Duration::from_nanos_u128` coming to a `std` near you. The rest are just a logical continuation. This also adds some "get units with a re...
diff --git a/src/signed_duration.rs b/src/signed_duration.rs index 778403c..6a89396 100644 --- a/src/signed_duration.rs +++ b/src/signed_duration.rs @@ -317,7 +317,6 @@ pub struct SignedDuration { nanos: i32, } - impl SignedDuration { /// A duration of zero time. /// @@ -526,6 +525,50 @@ impl SignedD...
1
344
5
c2d484625804729bb1593ee953dfe48aaf2233af
Andrew Gallant
2025-11-01T18:35:17
signed_duration: move constants to the top I think this is a more natural place for them. In particular, I kept going to the top of the file to look for them and then needing to scroll down through a bunch of docs.
diff --git a/src/signed_duration.rs b/src/signed_duration.rs index a77addb..778403c 100644 --- a/src/signed_duration.rs +++ b/src/signed_duration.rs @@ -12,6 +12,14 @@ use crate::{ #[cfg(not(feature = "std"))] use crate::util::libm::Float; +const NANOS_PER_SEC: i32 = 1_000_000_000; +const NANOS_PER_MILLI: i32 = 1_0...
1
8
7
53d41c53be0790cb6ac757ca03a4e0f5f92c94f3
Andrew Gallant
2025-11-01T18:35:16
fmt: slightly refactor duration parsing This brings the code for parsing duration strings (ISO 8601 and friendly) into `SignedDuration` or `Span` into more alignment. There are still some annoying differences. And some bugs I (re)discovered. They are marked as TODOs in this commit. The main motivation here is to sup...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 7198d0b..fa14daa 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -4,7 +4,8 @@ use crate::{ friendly::parser_label, util::{ fractional_time_to_duration, fractional_time_to_span, - ...
3
183
227
d8816b6a1c29b0345eb65198a2a0930800c8d0d7
Andrew Gallant
2025-11-01T18:35:15
fmt/friendly: simplify `set_span_unit_value` This is a slight refactor to reduce a little duplication. I don't mind duplication, but in this case, I was wondering why this block was repeated and had to very carefully scrutinize the code to follow it and make sure there weren't any differences. DRY in this case I thin...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 8cde138..7198d0b 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -893,39 +893,33 @@ struct HMS { fn set_span_unit_value( unit: Unit, value: t::NoUnits, - mut span: Span, + span: Span, ) -> Result<Spa...
1
21
27
211a36d5ecddf1aeb9b00648d9d5e631a5420903
Andrew Gallant
2025-10-30T01:31:31
bench: add benchmarks for parsing ISO 8601 durations I'm kind of surprised I hadn't added these yet. But I think among Jiff, Chrono and `time`, Jiff is the only one to support them. I'm going to be touching the implementation (in persuit of adding support for parsing/printing `std::time::Duration` directly), so I wan...
diff --git a/bench/src/parse.rs b/bench/src/parse.rs index 2694139..6b72af7 100644 --- a/bench/src/parse.rs +++ b/bench/src/parse.rs @@ -8,6 +8,7 @@ use crate::{benchmark, convert::ConvertFrom}; pub(super) fn define(c: &mut Criterion) { parse_civil_datetime(c); parse_friendly(c); + parse_iso8601_duration(...
1
61
0
aae54ca665e21db531fb97757923629e19f83d71
jesse
2025-10-27T18:19:02
api: actually export `ZonedSeries` This was an oversight that I missed in #430. PR #442
diff --git a/src/lib.rs b/src/lib.rs index 56291d4..a5c4966 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -759,7 +759,10 @@ pub use crate::{ TimestampDisplayWithOffset, TimestampRound, TimestampSeries, }, util::round::mode::RoundMode, - zoned::{Zoned, ZonedArithmetic, ZonedDifference, ZonedRound, Zo...
1
4
1
4b44d13192977b15e18b33ddd9d9d843d7beef18
Owen Walpole
2025-10-27T15:15:35
doc: fix typo in `Zoned` type documentation PR #441
diff --git a/src/zoned.rs b/src/zoned.rs index 170ac16..982c7c6 100644 --- a/src/zoned.rs +++ b/src/zoned.rs @@ -179,7 +179,7 @@ use crate::{ /// # Ok::<(), Box<dyn std::error::Error>>(()) /// ``` /// -/// (Note that this is diifferent from +/// (Note that this is different from /// [Temporal's `ZonedDateTime.equal...
1
1
1
f92871a2c77496b106c540da37d35ca52f424f02
Andrew Gallant
2025-10-23T17:27:12
tests: improve test failure message This test is failing intermittently on macOS. Which means that the initialization of the zoneinfo database is taking more than 500ms. I had scrutinized the CI logs and timestamps, and it looks like it's just random I/O delay when traversing the zoneinfo directory. Sigh.
diff --git a/tests/init/mod.rs b/tests/init/mod.rs index 544fd4c..92b8d71 100644 --- a/tests/init/mod.rs +++ b/tests/init/mod.rs @@ -39,7 +39,8 @@ fn zoned_now() { let limit = Duration::from_millis(500); assert!( first < limit, - "first `Zoned::now()` call should complete in less than {limit:?...
1
4
2
8383ebf05f86aaadfea440e180322631b3e97ee5
Andrew Gallant
2025-10-23T17:12:07
shared: remove commented out code
diff --git a/crates/jiff-static/src/shared/mod.rs b/crates/jiff-static/src/shared/mod.rs index 87d627e..067be4b 100644 --- a/crates/jiff-static/src/shared/mod.rs +++ b/crates/jiff-static/src/shared/mod.rs @@ -369,7 +369,6 @@ impl TzifDateTime { minute: i8, second: i8, ) -> TzifDateTime { - ...
2
0
2
06564abdf4352f89d7e91ccb95f5bbfebff6a404
Andrew Gallant
2025-10-22T16:04:50
dev: improve `Debug` experience for `PosixTimeZone` This commit adds a few targeted `Debug` constraints so that we can use `dbg!` a bit more freely.
diff --git a/crates/jiff-static/src/shared/posix.rs b/crates/jiff-static/src/shared/posix.rs index bb1892b..56362c8 100644 --- a/crates/jiff-static/src/shared/posix.rs +++ b/crates/jiff-static/src/shared/posix.rs @@ -1,5 +1,7 @@ // auto-generated by: jiff-cli generate shared +use core::fmt::Debug; + use super::{ ...
4
11
5
ba99ee49b44bded1d1f43ab7b0963c9ec2a26898
Andrew Gallant
2025-10-18T20:55:11
zoned: add arithmetic impls for `Zoned` Previously, we only had impls for `&Zoned`. These impls are a little weird because `Zoned` isn't `Copy`. So using them will result in consuming the `Zoned` value. But if that's okay, then having these impls is a nice quality of life improvement instead of a papercut. In the wors...
diff --git a/src/lib.rs b/src/lib.rs index 75ebeea..56291d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -369,7 +369,7 @@ use jiff::civil::date; let zdt1 = date(2020, 8, 26).at(6, 27, 0, 0).in_tz("America/New_York")?; let zdt2 = date(2023, 12, 31).at(18, 30, 0, 0).in_tz("America/New_York")?; -let span = &zdt2 - &zdt...
2
146
4
23cdd2545474431340035a5b7e5da3e26a11988c
Andrew Gallant
2025-10-18T18:55:21
fmt/strtime: make `strptime` with `Zoned` and only `%s` work Previously, if `%s` was parsed and there was no offset (`%z`) or IANA time zone identifier (`%Q`), then trying to pull a `Zoned` out of a `BrokenDownTime` would fail. But arguably, this should work. Namely, the `strptime` APIs are already very relaxed about ...
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index a4306b3..7b01114 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -1322,6 +1322,8 @@ impl BrokenDownTime { /// # Ok::<(), Box<dyn std::error::Error>>(()) /// ``` /// + /// # Example: time zone inconsistent with offse...
1
26
4
ee139f5a2b3d566f1c8753ddcadd93a02cb06c32
Andrew Gallant
2025-10-15T15:09:25
api: add `Zoned::series` I had been uncertain about how this should be implemented in the face of truly aberrant time zone transitions (like 2011-12-30 being missing from `Pacific/Apia`). But this particular method is incredibly useful _and_ is present on all of the other datetime types. So I think it's important enou...
diff --git a/src/civil/date.rs b/src/civil/date.rs index 918739d..4cd80fb 100644 --- a/src/civil/date.rs +++ b/src/civil/date.rs @@ -2548,8 +2548,10 @@ impl quickcheck::Arbitrary for Date { /// An iterator over periodic dates, created by [`Date::series`]. /// -/// It is exhausted when the next value would exceed a ...
5
249
40
1e3af6951eeced06d92a379d1e0dd069576a96cb
Andrew Gallant
2025-10-13T18:06:14
fmt: add more examples for `BrokenDownTime::to_timestamp` Specifically, document what happens when there is conflicting data parsed with `%s` and, say, `%Y-%m-%d`. This is a good example of why `strptime` is kinda fucked up, but on the same token, somewhat pragmatic in its utility.
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index fa25243..65213b9 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -1437,6 +1437,36 @@ impl BrokenDownTime { /// /// # Ok::<(), Box<dyn std::error::Error>>(()) /// ``` + /// + /// # Example: conflicting data + /...
1
30
0
877d90a5f60e1668575953256cbf307366d2ce57
Andrew Gallant
2025-10-10T12:25:31
bench: tweak benchmark names It doesn't make sense to distinguish between a duration and a span in the "construct timestamp from seconds" benchmark, so just use a more generic name here.
diff --git a/bench/src/timestamp.rs b/bench/src/timestamp.rs index cc1c607..33fb01f 100644 --- a/bench/src/timestamp.rs +++ b/bench/src/timestamp.rs @@ -127,7 +127,7 @@ fn from_seconds(c: &mut Criterion) { const EXPECTED: Timestamp = Timestamp::constant(SECONDS, 0); { - benchmark(c, format!("{NAME}/s...
1
3
3
bc00a543a232b6d4356fc85708b1e81b21de3c44
Andrew Gallant
2025-09-28T13:35:18
strtime: remove incorrect docs on `BrokenDownTime::set_meridiem` I missed this in the previous commit. Oops.
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index e9fb696..fa25243 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -2962,9 +2962,8 @@ impl BrokenDownTime { /// Set the meridiem (AM/PM). This is most useful when doing custom /// parsing that involves 12-hour time. /// ...
1
2
3
962edee175b633d8d41f7e264644929c59359245
Andrew Gallant
2025-09-26T00:35:38
shared: fix some panics in POSIX time zone parsing caught by a fuzzer The first one here was pretty embarrassing: the parser panicked on the empty string. The others were a bit subtler and had to do with incorrect construction of error messages. Arguably, more tests for the error cases here ought to be added. Fixes ...
diff --git a/crates/jiff-static/src/shared/posix.rs b/crates/jiff-static/src/shared/posix.rs index 4259c34..bb1892b 100644 --- a/crates/jiff-static/src/shared/posix.rs +++ b/crates/jiff-static/src/shared/posix.rs @@ -626,6 +626,11 @@ impl<'s> Parser<'s> { fn parse_posix_time_zone( &self, ) -> Result<...
2
70
12
69c87b86881dac2b4551c4a375fd4eeee91697c6
HBJ
2025-09-25T23:31:34
fmt/strtime: handle EOF after colons in a directive Fixes #410
diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs index 9a3d866..67d95d7 100644 --- a/src/fmt/strtime/format.rs +++ b/src/fmt/strtime/format.rs @@ -216,7 +216,7 @@ impl<'c, 'f, 't, 'w, W: Write, L: Custom> Formatter<'c, 'f, 't, 'w, W, L> { fn parse_extension(&mut self) -> Result<Extension, Error> ...
3
29
7
0cac480e2dfbb0faf12d3230382ee21e668dba73
Paolo Barbolini
2025-09-25T19:24:32
serde: switch `serde` dependency to `serde_core` serde_core has just been released. Crates that don't depend on serde derive macros should use it instead of serde, as it speeds up compile times by having the build for the crate itself be independent from serde-derive (in case it were to be enabled by some other crate)...
diff --git a/Cargo.toml b/Cargo.toml index 8c99d50..641a1ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,9 +48,9 @@ default = [ "tzdb-concatenated", "perf-inline", ] -std = ["alloc", "log?/std", "serde?/std"] -alloc = ["serde?/alloc", "portable-atomic-util/alloc"] -serde = ["dep:serde"] +std = ["alloc", "log?...
9
70
70
db6326cd8a8f745fc6d8f5d46d5756edefb188b6
David Pathakjee
2025-08-25T00:19:27
doc: fix typo PR #404
diff --git a/src/tz/mod.rs b/src/tz/mod.rs index 42d0b97..9f3dcaa 100644 --- a/src/tz/mod.rs +++ b/src/tz/mod.rs @@ -190,7 +190,7 @@ mod zic; /// /// Using a static `TimeZone` may also be faster in some cases. In particular, /// a `TimeZone` created at runtime from a `/usr/share/zoneinfo` uses -/// automic reference...
2
5
5
71ea43d41a3f69be6d0bec1e2ac57a012e26857f
Andrew Gallant
2025-06-25T14:33:11
lint: fix warnings about confusing lifetime elision This makes sense to me.
diff --git a/src/span.rs b/src/span.rs index ba66589..83b8bbc 100644 --- a/src/span.rs +++ b/src/span.rs @@ -5879,7 +5879,7 @@ impl<'a> Relative<'a> { /// This returns an error in the same cases as the underlying checked /// arithmetic APIs. In general, this occurs when adding the given `span` /// would ...
4
22
22
e355d4880e0e8a0df3ddefbd1cbcc7c2328b9ac8
Andrew Gallant
2025-06-13T18:10:07
error: partially re-inline error constructors It turns out that #379 ended up pretty badly regressing datetime parsing performance. In particular, the `with_context` routine on `Result<T, E>` was _eagerly_ calling the caller-provided closure even in the success case. Which means error values (which are generally much ...
diff --git a/src/error.rs b/src/error.rs index 539091f..e817c1b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -647,18 +647,7 @@ impl ErrorContext for Error { impl<T> ErrorContext for Result<T, Error> { #[cfg_attr(feature = "perf-inline", inline(always))] fn context(self, consequent: impl IntoError) -> Resu...
1
2
24
78ba38538b6249a381192627173b3f29794ec892
Teoh Han Hui
2025-06-01T13:44:55
doc: fix outdated mentions of `Span` assuming 24-hour days PR #382
diff --git a/src/span.rs b/src/span.rs index 446227e..ba66589 100644 --- a/src/span.rs +++ b/src/span.rs @@ -3311,8 +3311,6 @@ impl core::ops::Mul<Span> for i64 { /// Converts a `Span` to a [`std::time::Duration`]. /// -/// Note that this assumes that days are always 24 hours long. -/// /// # Errors /// /// This...
1
0
4
c0cfb2390d6fbdf1163e8de33c6d5cf4e5be8d0e
Andrew Gallant
2025-05-18T17:56:59
test: add another scratch test for printing some interesting spans Ref #373
diff --git a/src/lib.rs b/src/lib.rs index 9f383b5..11e3de6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -824,4 +824,39 @@ mod tests { dbg!((t::UnixSeconds::MIN, t::UnixSeconds::MAX)); dbg!((t::UnixEpochDay::MIN, t::UnixEpochDay::MAX)); } + + #[cfg(feature = "std")] + #[test] + fn maximal...
1
35
0
ca0697735b201085fac11ea46ad616ddba33442b
Andrew Gallant
2025-05-17T18:58:19
error: try to reduce amount of codegen by forcefully unlining error constructors I had tried this several weeks ago, but recent exploration in #373 prompted me to revisit it. Indeed, `cargo llvm-lines` reveals that Jiff is emitting a _ton_ of code to LLVM just due to its error values. I don't know how much of this is ...
diff --git a/src/error.rs b/src/error.rs index 14085c2..539091f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -131,6 +131,32 @@ impl Error { pub fn from_args<'a>(message: core::fmt::Arguments<'a>) -> Error { Error::from(ErrorKind::Adhoc(AdhocError::from_args(message))) } + + #[inline(never)] + ...
1
78
45
4e4939d199838210f13d57703e231915e6e42320
Andrew Gallant
2025-05-08T20:52:55
jiff-icu: bump ICU4X to 2.0.0
diff --git a/crates/jiff-icu/Cargo.toml b/crates/jiff-icu/Cargo.toml index 955b93e..7970ff0 100644 --- a/crates/jiff-icu/Cargo.toml +++ b/crates/jiff-icu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-icu" -version = "0.2.0-beta.2" #:version +version = "0.2.0" #:version authors = ["Andrew Gallant <jamslam@gmail...
2
5
5
e729efaea3206b14a5537f10d2423f85a5dd68e9
Andrew Gallant
2025-05-08T20:44:47
jiff-icu: upgrade to ICU4X 2.0.0 This mostly just involved doing some renames.
diff --git a/crates/jiff-icu/src/lib.rs b/crates/jiff-icu/src/lib.rs index 4b9cb7b..823b8d4 100644 --- a/crates/jiff-icu/src/lib.rs +++ b/crates/jiff-icu/src/lib.rs @@ -50,7 +50,7 @@ let icu_zdt = ZonedDateTime::<Iso, _>::convert_from(&zdt); // Format for the en-GB locale: let formatter = DateTimeFormatter::try_new( ...
1
23
21
92f25e0f90d74fc9bf9506c1d69817c18e2ea342
Andrew Gallant
2025-05-08T12:38:22
tz: fix typo in log message
diff --git a/src/tz/system/mod.rs b/src/tz/system/mod.rs index 458b04a..acf7253 100644 --- a/src/tz/system/mod.rs +++ b/src/tz/system/mod.rs @@ -231,7 +231,7 @@ fn get_env_tz(db: &TimeZoneDatabase) -> Result<Option<TimeZone>, Error> { trace!( "using TZ={tz_name_or_path:?} as time z...
1
1
1
5336ffb81165de6250ca7c26569004c47d30eed0
Andrew Gallant
2025-05-06T00:44:11
doc: fix outdated reference to `Eq` implementation on `Span` This was removed in `jiff 0.2` in favor of an `Eq` implementation on the new `SpanFieldwise` type.
diff --git a/src/span.rs b/src/span.rs index 6a379e6..446227e 100644 --- a/src/span.rs +++ b/src/span.rs @@ -1889,11 +1889,11 @@ impl Span { /// /// Two spans compare equal when they correspond to the same duration /// of time, even if their individual fields are different. This is in - /// contrast t...
1
5
5
11b286deeddd49e197620fc3ccc4b54a919aa915
Andrew Gallant
2025-05-01T19:38:38
jiff-icu-0.2.0-beta.2
diff --git a/crates/jiff-icu/Cargo.toml b/crates/jiff-icu/Cargo.toml index 69a3611..d95d06e 100644 --- a/crates/jiff-icu/Cargo.toml +++ b/crates/jiff-icu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-icu" -version = "0.1.0" #:version +version = "0.2.0-beta.2" #:version authors = ["Andrew Gallant <jamslam@gmail...
1
3
3
2dc5b00d2eadba45190081eede67c3848b28d95a
Stepan Koltsov
2025-05-01T12:26:20
doc: fix typo in "formatting" PR #354
diff --git a/src/civil/datetime.rs b/src/civil/datetime.rs index e34011b..c26fef4 100644 --- a/src/civil/datetime.rs +++ b/src/civil/datetime.rs @@ -2527,7 +2527,7 @@ impl core::fmt::Debug for DateTime { /// Converts a `DateTime` into an ISO 8601 compliant string. /// -/// # Forrmatting options supported +/// # For...
4
5
5
d395262c24e7821d05885c29059816048fe36344
Andrew Gallant
2025-05-01T00:24:13
fmt/strtime: remove breadcrumbs comment This was meant to be removed before merging. Oh well.
diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs index 6f0bcd3..9a3d866 100644 --- a/src/fmt/strtime/format.rs +++ b/src/fmt/strtime/format.rs @@ -14,11 +14,6 @@ use crate::{ Error, }; -// BREADCRUMBS: For lenient parsing, I guess should we move the top-level -// `match` expression to a separa...
1
0
5
8860d97b0b2b17333e66954b7c8488f3de7041f6
Andrew Gallant
2025-04-30T20:07:40
fmt/strtime: use Temporal offset parser in `strptime` I originally didn't do this because I perceived the offset parsing in `strptime` to be "simple," and I didn't want to complicate the Temporal offset parser. But now that we seek to support `%::z` and `%:::z` in `strptime`, it makes sense to DRY things up a bit.
diff --git a/src/fmt/offset.rs b/src/fmt/offset.rs index 0bd5430..b250b4a 100644 --- a/src/fmt/offset.rs +++ b/src/fmt/offset.rs @@ -289,14 +289,22 @@ impl core::fmt::Debug for Numeric { #[derive(Debug)] pub(crate) struct Parser { zulu: bool, + require_minute: bool, subminute: bool, subsecond: bool,...
2
109
171
0957978baeff487ea4ec4dc3e4d09d522c6c3ec3
Andrew Gallant
2025-04-30T19:24:03
fmt/strtime: add more `%z` and `%:z` tests We're going to be gutting the offset parsing, so let's add some tests for it to make sure we don't break anything.
diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs index 856ea92..1ab7dd6 100644 --- a/src/fmt/strtime/format.rs +++ b/src/fmt/strtime/format.rs @@ -962,6 +962,7 @@ mod tests { use crate::{ civil::{date, time, Date, DateTime, Time}, fmt::strtime::{format, BrokenDownTime, Config, P...
2
92
1
2087383c2c9c37646b433acab78bed5d0f9cc74f
Andrew Gallant
2025-04-30T11:51:19
fmt/strtime: touchups for `%N` I had forgotten to update the docs. And I added another test. Ref #344
diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs index 9493f42..856ea92 100644 --- a/src/fmt/strtime/format.rs +++ b/src/fmt/strtime/format.rs @@ -1149,6 +1149,7 @@ mod tests { insta::assert_snapshot!(f("%N", mk(123_000_000)), @"123000000"); insta::assert_snapshot!(f("%N", mk(0)), ...
3
6
4
6f77691deee6998f1f28e6bcff73bb2867ef3de6
Andrew Gallant
2025-04-30T00:30:12
fmt: remove old commented out code
diff --git a/src/fmt/offset.rs b/src/fmt/offset.rs index f940a52..0bd5430 100644 --- a/src/fmt/offset.rs +++ b/src/fmt/offset.rs @@ -11,12 +11,10 @@ from [Temporal's hybrid grammar]. // Here's the specific part of Temporal's grammar that is implemented below: // -// # Parser::new().zulu(true).subminute(true).parse(...
1
0
2
836bc15e379a05aa3ab068b5298b2ce385364dfc
Andrew Gallant
2025-04-28T15:44:41
bench: add `strftime` benchmark This actually never got any optimization attention, and it looks like its perf matters to coreutils. So let's take a look at it! Ref https://github.com/uutils/coreutils/issues/7852
diff --git a/bench/src/print.rs b/bench/src/print.rs index fdc3daa..db757c7 100644 --- a/bench/src/print.rs +++ b/bench/src/print.rs @@ -7,6 +7,7 @@ use crate::{benchmark, convert::ConvertFrom}; pub(super) fn define(c: &mut Criterion) { print_civil_datetime(c); + print_strftime(c); } /// Measures the tim...
1
86
0
ea763735a1b77e4db3929012e8755a45aab3b335
Andrew Gallant
2025-04-27T23:40:57
error: add a public method for constructing `Error` values I've finally relented and exposes a very restricted way to build an `Error` value. I was motivated to do this because there are some traits in Jiff that use `jiff::Error` in their return types. Without a constructor like this, it isn't possible for implemento...
diff --git a/src/error.rs b/src/error.rs index c06f124..0579332 100644 --- a/src/error.rs +++ b/src/error.rs @@ -109,14 +109,34 @@ enum ErrorKind { IO(IOError), } +impl Error { + /// Creates a new error value from `core::fmt::Arguments`. + /// + /// It is expected to use [`format_args!`](format_args) f...
1
25
5
9eeb9949b737dcf010d5e343be5d1984cfff19af
Andrew Gallant
2025-04-25T16:43:58
fmt: remove comment about incremental parsing That API was added, so this is really no longer needed.
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index cb5d58d..6cc2e89 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -465,12 +465,6 @@ pub fn format( // only catch is that you can't omit time units bigger than any present time // unit. For example, only `%M` doesn't fly. If you want...
1
0
6
febe58d91d4724b326c408f37bdf431d22d111c9
Andrew Gallant
2025-04-25T02:50:03
jiff-icu: squash unused import warnings
diff --git a/crates/jiff-icu/src/lib.rs b/crates/jiff-icu/src/lib.rs index f96c694..a73b291 100644 --- a/crates/jiff-icu/src/lib.rs +++ b/crates/jiff-icu/src/lib.rs @@ -170,11 +170,10 @@ use icu_time::{ DateTime as IcuDateTime, Time as IcuTime, TimeZone as IcuTimeZone, TimeZoneInfo as IcuTimeZoneInfo, ZonedDa...
1
3
4
69dbc90c5fff593842000ab999138ae39fdfbc73
Andrew Gallant
2025-04-24T21:07:45
jiff-icu: add support for zoned datetimes
diff --git a/crates/jiff-icu/src/lib.rs b/crates/jiff-icu/src/lib.rs index 482dfec..f96c694 100644 --- a/crates/jiff-icu/src/lib.rs +++ b/crates/jiff-icu/src/lib.rs @@ -8,6 +8,9 @@ traits from the standard library. # Available conversions +* [`jiff::Zoned`] infallibly converts to +[`icu::time::ZonedDateTime`](icu_...
2
230
5
13bd8ab8f0681ccd95aa58e68a31752e407a5306
Philippe Loctaux
2025-04-21T13:28:17
doc: fix typo PR #332
diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs index 202be37..cb5d58d 100644 --- a/src/fmt/strtime/mod.rs +++ b/src/fmt/strtime/mod.rs @@ -601,7 +601,7 @@ impl BrokenDownTime { /// # Ok::<(), Box<dyn std::error::Error>>(()) /// ``` /// - /// # Example: how to parse a only parse of a time...
1
1
1
df373bdde2b40e19b58dee5f97d15214f6cc5c2b
Joseph Cooper
2025-04-17T12:28:48
doc: fix typo Correct typo in comment about regression test for `SignedDuration::try_from_secs_f32()`. PR #327
diff --git a/src/signed_duration.rs b/src/signed_duration.rs index f2e5654..27e8fac 100644 --- a/src/signed_duration.rs +++ b/src/signed_duration.rs @@ -2890,7 +2890,7 @@ mod tests { assert_eq!(sdur, SignedDuration::new(-9223372036854775808, 0)); } - /// See `panic_try_from_secs_f32`. + /// See `p...
1
1
1
06b94b52aee868c84c50777dbee023aed58f0538
Andrew Gallant
2025-04-11T20:44:26
jiff-static: add `perf-inline` feature to `jiff-static` In practice, we do this because otherwise `cfg_attr(feature = "perf-inline")` will throw a warning otherwise. And that happens because we use these annotations in code in Jiff that is shared (via copying) with `jiff-static`. So instead of just removing the annota...
diff --git a/crates/jiff-static/Cargo.toml b/crates/jiff-static/Cargo.toml index bb0fa93..07aee7f 100644 --- a/crates/jiff-static/Cargo.toml +++ b/crates/jiff-static/Cargo.toml @@ -30,6 +30,10 @@ tzdb = ["dep:jiff-tzdb"] # See the `tz-fat` feature in this repository's root `Cargo.toml` for more # context. tz-fat = [...
1
4
0
5a6f268e8296335506d80f928661e6a87e081bbd
Andrew Gallant
2025-04-11T19:34:36
cargo: add `perf-inline` crate feature This is copied over from `regex`. Basically, when this is enabled (which is the default), then a bunch of `inline(always)` annotations are scattered in places (as motivated by micro-benchmarking). Otherwise, these annotations are removed.
diff --git a/Cargo.toml b/Cargo.toml index 565e3f4..119828c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,7 @@ default = [ "tzdb-bundle-platform", "tzdb-zoneinfo", "tzdb-concatenated", + "perf-inline", ] std = ["alloc", "log?/std", "serde?/std"] alloc = ["serde?/alloc", "portable-atomic-util/alloc"...
17
129
114
692725befeb9297a412487a70d4e72bb94dcad22
Andrew Gallant
2025-04-11T19:34:35
rustc: remove some generics This improves compile times slightly in some ad hoc experiments. I thought this might help more than it ultimately did.
diff --git a/src/civil/date.rs b/src/civil/date.rs index 9a69f31..73e5491 100644 --- a/src/civil/date.rs +++ b/src/civil/date.rs @@ -1133,13 +1133,15 @@ impl Date { let year = t::NoUnits32::rfrom(self.year_ranged()); let week_start = t::NoUnits32::vary([days, year], |[days, year]| { let m...
10
139
186
08903c55ec12a5cc83b52c0711cbf443d6d680b7
Joey de Waal
2025-04-11T19:03:46
tz: treat an empty `TZ` environment variable as `TZ=UTC` Specifically, an environment variable that is *set* to the empty string. This seems like odd behavior to me, but it's apparently what both GNU and BSD tooling do. And since Jiff's support for `TZ` is really about conforming to existing convention, we just do wh...
diff --git a/src/tz/system/mod.rs b/src/tz/system/mod.rs index d10cf2a..458b04a 100644 --- a/src/tz/system/mod.rs +++ b/src/tz/system/mod.rs @@ -175,7 +175,10 @@ fn get_env_tz(db: &TimeZoneDatabase) -> Result<Option<TimeZone>, Error> { let Some(tzenv) = std::env::var_os("TZ") else { return Ok(None) }; if tz...
1
4
1
f41d58644536228958af3978df7cc612bf48f36f
Andrew Gallant
2025-04-06T13:31:23
shared: remove pointless `as_ref` I believe the signature of the constructor was originally generic over `AsRef<[u8]>`, but it got changed to be concrete. However, the implementation continued calling `as_ref()` unnecessarily. This looks harmless, but exposes us to inference failures. Ref https://github.com/rust-lang...
diff --git a/src/shared/posix.rs b/src/shared/posix.rs index 2f8c76e..6e88a45 100644 --- a/src/shared/posix.rs +++ b/src/shared/posix.rs @@ -22,8 +22,7 @@ impl PosixTimeZone<Abbreviation> { // `0..=24`.) Requiring strict POSIX rules doesn't seem necessary // since the extension is a strict superset. P...
1
2
4
a22abc76174521993364e325d251b6b3d27bc2f0
Andrew Gallant
2025-03-31T22:28:52
bench: add benchmarks for constructing a timestamp type Both `chrono` and `time` use more elaborate representations for their canonical "timestamp" data types. In contrast, Jiff just uses an integer number of nanoseconds (like `std::time::Duration`). This makes, among other things, construction from an integer virtual...
diff --git a/bench/src/convert.rs b/bench/src/convert.rs index 442ff33..7755ed5 100644 --- a/bench/src/convert.rs +++ b/bench/src/convert.rs @@ -112,6 +112,13 @@ impl ConvertFrom<jiff::Timestamp> for time::OffsetDateTime { } } +impl ConvertFrom<jiff::Timestamp> for time::UtcDateTime { + fn convert_from(x: ji...
2
47
0
ef5ee45a1b90cab2d5affae6323a878c151a786c
Patryk Wychowaniec
2025-03-30T17:26:51
span: avoid cloning when rounding PR #303
diff --git a/src/span.rs b/src/span.rs index 2b283c1..679510b 100644 --- a/src/span.rs +++ b/src/span.rs @@ -6088,9 +6088,8 @@ impl<'a> Relative<'a> { if smallest >= Unit::Day { Nudge::relative_calendar( relspan.span, - // FIXME: Find...
2
17
3
e2799168b675b1f9cad8bcffe4a43eb3e6164dc2
Andrew Gallant
2025-03-30T12:26:11
civil: fix unclear code This doesn't change any behavior, but some of the names in this code were very unclear or outright misleading. I believe it's because this code went through a lot of refactorings and I never swung back around to clean it up.
diff --git a/src/civil/date.rs b/src/civil/date.rs index 1f29b7b..7038f3f 100644 --- a/src/civil/date.rs +++ b/src/civil/date.rs @@ -1762,7 +1762,7 @@ impl Date { other: A, ) -> Result<Span, Error> { let args: DateDifference = other.into(); - let span = args.until_with_largest_unit(self)?;...
1
9
9
86e149711711e7092ec4faf74ef0faae3992d898
Andrew Gallant
2025-03-23T00:40:14
deps: bump to jiff-tzdb-platform 0.1.3
diff --git a/Cargo.toml b/Cargo.toml index f4f34d4..1ff9a13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -208,7 +208,7 @@ jiff-static = { version = "=0.2.4", path = "crates/jiff-static" } # is enabled by default, but that the `tzdb-bundle-platform` crate is only # actually used on platforms without a system tzdb (i.e....
1
1
1
939549520e6004b051b02c8b5f74973b833f3670
Andrew Gallant
2025-03-23T00:39:37
jiff-tzdb-platform-0.1.3
diff --git a/crates/jiff-tzdb-platform/Cargo.toml b/crates/jiff-tzdb-platform/Cargo.toml index 9a372c2..8fd9253 100644 --- a/crates/jiff-tzdb-platform/Cargo.toml +++ b/crates/jiff-tzdb-platform/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-tzdb-platform" -version = "0.1.2" #:version +version = "0.1.3" #:version...
1
1
1
ebd7ee41f398cee1331706d204325d2e150fd166
Andrew Gallant
2025-03-23T00:39:28
deps: bump to jiff-tzdb 0.1.4
diff --git a/Cargo.toml b/Cargo.toml index 41000ae..f4f34d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -184,7 +184,7 @@ js = ["dep:wasm-bindgen", "dep:js-sys"] [dependencies] jiff-static = { version = "0.2", path = "crates/jiff-static", optional = true } -jiff-tzdb = { version = "0.1.2", path = "crates/jiff-tzdb",...
3
3
3
3ff4513edf2cab9174dab3f2871b2dbfe3b9d740
Andrew Gallant
2025-03-23T00:38:00
jiff-tzdb-0.1.4
diff --git a/crates/jiff-tzdb/Cargo.toml b/crates/jiff-tzdb/Cargo.toml index 5b70fff..3374467 100644 --- a/crates/jiff-tzdb/Cargo.toml +++ b/crates/jiff-tzdb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-tzdb" -version = "0.1.3" #:version +version = "0.1.4" #:version authors = ["Andrew Gallant <jamslam@gmail.c...
1
1
1
83c068803ef13127663bf30edb8d653e63fe0ade
Andrew Gallant
2025-03-16T18:32:48
fmt: fix ISO 8601 week date example I was using `%w` to format the day of the week in examples referencing ISO 8601 week days, but the correct directive is `%u`. The difference is that the former uses `0` for Sunday and the latter uses `7` for Sunday. (So in the examples given, this doesn't actually change the output....
diff --git a/src/fmt/mod.rs b/src/fmt/mod.rs index fc7a7f4..dce32c9 100644 --- a/src/fmt/mod.rs +++ b/src/fmt/mod.rs @@ -93,7 +93,7 @@ Jiff and the latter provides a [`BrokenDownTime`] for granular parsing. | ------- | ------------- | | `2025-05-20` | `%Y-%m-%d` | | `2025-05-20` | `%F` | -| `2025-W21-2` | `%G-W%V-%w...
2
3
3
deee5c4229d54708535b900ad592d7827396c0a3
Andrew Gallant
2025-03-14T12:26:24
doc: clarify the guaranteeds for `Zoned::{since,until}` Specifically, that you can't get any units bigger than hours *by default*. We also fix what was probably a copy-and-paste error in the `Sub` trait implementation docs for `Zoned`. (I probably copied it from `jiff::civil::DateTime`, where it can return days by de...
diff --git a/src/civil/datetime.rs b/src/civil/datetime.rs index f53bec2..a70c187 100644 --- a/src/civil/datetime.rs +++ b/src/civil/datetime.rs @@ -1868,6 +1868,9 @@ impl DateTime { /// Depending on the input provided, the span returned is rounded. It may /// also be balanced up to bigger units than the defa...
2
10
3
460a0bc039f1a8c8381c97d4d207ff755157bee1
Andrew Gallant
2025-03-07T01:17:33
tz: fix comment and remove superfluous `repr(align(..))` When I originally wrote the comment on `Repr`, I got the alignment wrong. But I caught that mistake and fixed it before merging anything to `master`. I just hadn't updated the comment. The `repr(align(..))` was leftovers from experimenting with a `TzifDateTime`...
diff --git a/src/shared/mod.rs b/src/shared/mod.rs index e30f894..2331bec 100644 --- a/src/shared/mod.rs +++ b/src/shared/mod.rs @@ -365,7 +365,6 @@ pub enum TzifTransitionKind { /// extremely cheap. This is especially useful since we do a binary search on /// `&[TzifDateTime]` when doing a TZ lookup for a civil date...
2
1
2
c7edc0a1054bb7f0da8ebed4afc0c6b63b29b361
Andrew Gallant
2025-03-06T21:34:30
jiff-static: fix crate layout I wasn't sure why `cargo package` wasn't picking up `crates/jiff-static/shared`. So I switched to a traditional `src` layout, which shouldn't be necessary. Indeed, that didn't fix things. Turns out, I had a bunk `include` rule. But I wanted to switch to the `src` scheme anyway, so leave ...
diff --git a/crates/jiff-static/Cargo.toml b/crates/jiff-static/Cargo.toml index 55826fc..bf4b4c4 100644 --- a/crates/jiff-static/Cargo.toml +++ b/crates/jiff-static/Cargo.toml @@ -12,12 +12,11 @@ keywords = ["date", "time", "static", "zone", "iana"] workspace = "../.." edition = "2021" rust-version = "1.70" -includ...
13
1
2
08571714a9ecaa37bff86b480433fae2760756a2
Andrew Gallant
2025-03-06T21:28:38
jiff-tzdb-0.1.3
diff --git a/crates/jiff-tzdb/Cargo.toml b/crates/jiff-tzdb/Cargo.toml index 97e1532..5b70fff 100644 --- a/crates/jiff-tzdb/Cargo.toml +++ b/crates/jiff-tzdb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-tzdb" -version = "0.1.2" #:version +version = "0.1.3" #:version authors = ["Andrew Gallant <jamslam@gmail.c...
1
1
1
300886fef3d1d14511c62111feed3340f96a6ce2
Andrew Gallant
2025-03-06T21:28:21
jiff-diesel-0.1.3
diff --git a/crates/jiff-diesel/Cargo.toml b/crates/jiff-diesel/Cargo.toml index 75b3097..aebd519 100644 --- a/crates/jiff-diesel/Cargo.toml +++ b/crates/jiff-diesel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-diesel" -version = "0.1.2" #:version +version = "0.1.3" #:version authors = ["Andrew Gallant <jamsl...
1
1
1
252a0806dc3c6bd4f6217f7029709a9e24994998
Andrew Gallant
2025-03-06T21:28:08
jiff-sqlx-0.1.1
diff --git a/crates/jiff-sqlx/Cargo.toml b/crates/jiff-sqlx/Cargo.toml index 1caf7be..93f4d77 100644 --- a/crates/jiff-sqlx/Cargo.toml +++ b/crates/jiff-sqlx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jiff-sqlx" -version = "0.1.0" #:version +version = "0.1.1" #:version authors = ["Andrew Gallant <jamslam@gmail.c...
1
1
1
c789dd50b9ea376d275b17ed1ed5235b53bb5214
Andrew Gallant
2025-03-06T20:48:32
fmt: disable snapshot tests on core-only For whatever reason, these seem to take a hideously long time to run in CI. They even take a long time to run locally, *relatively* speaking. In core-only, `insta` doesn't support snapshotting at all, which is a huge bummer. So we just tell insta to force the tests to pass and ...
diff --git a/src/fmt/friendly/parser.rs b/src/fmt/friendly/parser.rs index 9333564..460c6f0 100644 --- a/src/fmt/friendly/parser.rs +++ b/src/fmt/friendly/parser.rs @@ -980,6 +980,7 @@ fn is_whitespace(byte: &u8) -> bool { matches!(*byte, b' ' | b'\t' | b'\n' | b'\r' | b'\x0C') } +#[cfg(feature = "alloc")] #[c...
7
7
0
eb615881262f7a7947e4d9da8af2d043f461505c
Andrew Gallant
2025-03-06T16:40:08
zoned: improve docs for `Zoned::subsec_nanosecond` It is tempting to think of this method as just being a shortcut for `zdt.timestamp().subsec_nanosecond()`, but it actually isn't! It's returning the fractional seconds on the *civil* datetime, not the timestamp. These are usually the same for times after the Unix epoc...
diff --git a/src/zoned.rs b/src/zoned.rs index 6baf0f9..00577ee 100644 --- a/src/zoned.rs +++ b/src/zoned.rs @@ -893,6 +893,14 @@ impl Zoned { /// /// The value returned is guaranteed to be in the range `0..=999_999_999`. /// + /// Note that this returns the fractional second associated with the civil...
1
30
2
9a23a442af707f0be0ad6b2399a7710df57e18e4
Andrew Gallant
2025-03-06T13:35:12
jiff-static: update `shared` copy of code
diff --git a/crates/jiff-static/shared/mod.rs b/crates/jiff-static/shared/mod.rs index 422f8fd..c2b1ac4 100644 --- a/crates/jiff-static/shared/mod.rs +++ b/crates/jiff-static/shared/mod.rs @@ -350,30 +350,17 @@ pub enum TzifTransitionKind { /// do not need to represent fractional seconds. This lets us easily represent...
2
28
33
98164d6263b4389c9b96cb618eac53222052caba
Andrew Gallant
2025-03-05T23:29:05
tz: pack TZif civil datetime into i64 This leads to amazing speed-ups for TZ lookups on civil datetimes: tz/posix_datetime_to_offset/jiff 1.00 32.6±0.70ns ? ?/sec 1.01 32.9±0.28ns ? ?/sec tz/posix_timestamp_to_offset/jiff 1.00 21.8±0.17ns ? ?/sec ...
diff --git a/crates/jiff-static/lib.rs b/crates/jiff-static/lib.rs index a7ee1a9..99d11b7 100644 --- a/crates/jiff-static/lib.rs +++ b/crates/jiff-static/lib.rs @@ -46,7 +46,7 @@ use quote::quote; use self::shared::{ util::array_str::Abbreviation, PosixDay, PosixDayTime, PosixDst, - PosixOffset, PosixRule, P...
6
179
71
c9f72a5b5624659da647cd9a1f2b5f178b60aeb3
Andrew Gallant
2025-03-05T23:29:04
tz: make `tzif::Transition` smaller This is an easy win that uses 64-bit integers to represent a timestamp instead of 96-bit integers. This is okay because this reflects what the actual source IANA time zone database uses. This makes the binary search lookup a fair a bit faster. Next I'd like to split `Transition` i...
diff --git a/src/tz/tzif.rs b/src/tz/tzif.rs index 0ae458b..97b21a2 100644 --- a/src/tz/tzif.rs +++ b/src/tz/tzif.rs @@ -272,6 +272,7 @@ impl< &self, timestamp: Timestamp, ) -> Result<&LocalTimeType, &PosixTimeZone<ABBREV>> { + let timestamp = timestamp.as_second(); // This is gua...
1
20
13
5af655e5ea64e402562beeae015fd00c0b63e70c
Andrew Gallant
2025-03-05T23:29:03
tz: add new enabled-by-default `tz-fat` feature When enabled, this feature will "fatten" TZif data by adding more time zone transitions. This corresponds to what tzdb's `zic` program does when `-b fat` is given, except Jiff does it at runtime. If the TZif data has already been fattened, then this has no effect. The r...
diff --git a/Cargo.toml b/Cargo.toml index 8bd070e..08af92f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,7 @@ exclude = [ default = [ "std", "tz-system", + "tz-fat", "tzdb-bundle-platform", "tzdb-zoneinfo", "tzdb-concatenated", @@ -69,6 +70,52 @@ logging = ["dep:log"] # require extra dependen...
6
311
6
5817ed298b1d5566c9970eb5368445a2588abfed
Andrew Gallant
2025-03-05T23:29:02
tz: add back POSIX time zone consistency check This got lost in the most recently POSIX time zone refactor. We add it back here.
diff --git a/src/tz/tzif.rs b/src/tz/tzif.rs index 46d6553..8b6e9eb 100644 --- a/src/tz/tzif.rs +++ b/src/tz/tzif.rs @@ -15,7 +15,7 @@ use alloc::{string::String, vec::Vec}; use crate::{ civil::DateTime, - error::Error, + error::{err, Error}, shared, timestamp::Timestamp, tz::{ @@ -170,7 +1...
1
64
6
951a9a1567929e7fbade35cdd197a00d43ad4bba
Andrew Gallant
2025-03-05T23:29:01
span: fix TODO comment in error message It looks like I never circled back around to fix the error message here when I added the `SpanRelativeTo::days_are_24_hours()` functionality. So fix that here. It's hard to keep `SpanRelativeToKind`'s `Display` impl, because the error message kinda needs to be rejiggered at a h...
diff --git a/src/span.rs b/src/span.rs index 26c4dad..63f0714 100644 --- a/src/span.rs +++ b/src/span.rs @@ -2397,12 +2397,26 @@ impl Span { }; let relspan = result .and_then(|r| r.into_relative_span(Unit::Second, *self)) - .with_context(|| { - err!( - ...
1
20
16
fc993ca79a1865c61b379d2f90d34e80b1069da6
Andrew Gallant
2025-03-05T23:29:01
shared: move more date algorithms to `itime` This isn't all of them, but I specifically prioritized the ones I think I'll need for handling POSIX time zones.
diff --git a/crates/jiff-static/shared/util/itime.rs b/crates/jiff-static/shared/util/itime.rs index 9695b40..0b43cd5 100644 --- a/crates/jiff-static/shared/util/itime.rs +++ b/crates/jiff-static/shared/util/itime.rs @@ -24,7 +24,7 @@ they are internal types. Specifically, to distinguish them from Jiff's public types....
10
720
87
843adbea82ff6f942f3b1e7ce0279162fa085d86
Andrew Gallant
2025-03-05T23:29:00
shared: define one `Error` type in `shared` I think we're going to use this more. So we might as well put it in one place. And also, make it core-only compatible via degraded error messages.
diff --git a/crates/jiff-static/lib.rs b/crates/jiff-static/lib.rs index 2b69128..4cfb9db 100644 --- a/crates/jiff-static/lib.rs +++ b/crates/jiff-static/lib.rs @@ -54,6 +54,7 @@ use self::shared::{ /// /// The main thing we use in here is the parsing routine for TZif data and /// shared data types for representing ...
10
469
75
41cd2b8643b17921ad507e1394aa285d4f9a5e00
Andrew Gallant
2025-03-05T23:28:59
shared: move core datetime algorithms Instead of just free functions operating on tuples, we actually give them names. Ranged integers keep pissing me off. The fact that I have "primitive" datetime types and "ranged" datetime types is just absolutely infuriating and creating a lot of dissonance. But at least the new...
diff --git a/src/civil/date.rs b/src/civil/date.rs index c6f6acc..a1e34df 100644 --- a/src/civil/date.rs +++ b/src/civil/date.rs @@ -10,10 +10,10 @@ use crate::{ self, temporal::{DEFAULT_DATETIME_PARSER, DEFAULT_DATETIME_PRINTER}, }, + shared::util::itime::{self, IDate, IEpochDay}, tz::Ti...
11
644
420
6275d26530a747b7020fea3506f3162c3de22371
Andrew Gallant
2025-03-05T23:28:58
rangeint: add new `Composite` ranged type This takes some brutalness out of writing routines for converting to and from composite types over ranged integers (like `civil::Date`). This whole mess is a consequence of using ranged integers and simultaneously implementing our low level datetime algorithms on primitive in...
diff --git a/src/civil/date.rs b/src/civil/date.rs index 8cf3daf..c6f6acc 100644 --- a/src/civil/date.rs +++ b/src/civil/date.rs @@ -13,7 +13,7 @@ use crate::{ tz::TimeZone, util::{ common, - rangeint::{ri16, ri8, RFrom, RInto, TryRFrom}, + rangeint::{self, ri16, ri8, RFrom, RInto, TryR...
5
265
321
da67afe6f43ad078eba268549933ef2aea6edf33
Andrew Gallant
2025-03-05T23:28:58
tz: remove use of `String` when parsing POSIX time zones This was just really bugging me. And if we're going to move more of the POSIX time zone implementation into `shared`, we might as well just bite the bullet and do this too. Now I believe the only parts of POSIX time zones that require `alloc` are parsing the `:...
diff --git a/crates/jiff-static/lib.rs b/crates/jiff-static/lib.rs index acca8c2..2b69128 100644 --- a/crates/jiff-static/lib.rs +++ b/crates/jiff-static/lib.rs @@ -45,8 +45,9 @@ use proc_macro::TokenStream; use quote::quote; use self::shared::{ - PosixDay, PosixDayTime, PosixDst, PosixRule, PosixTimeZone, TzifF...
9
101
80
7b724ba3802a52f93245b59882f2a073491e81cb
Andrew Gallant
2025-03-05T23:28:54
shared: move `ArrayStr` into `shared` module So that we can use it in `jiff` and `jiff-static`. This will avoid using a `String` at all when creating or using POSIX time zones.
diff --git a/crates/jiff-static/shared/util/array_str.rs b/crates/jiff-static/shared/util/array_str.rs new file mode 100644 index 0000000..0105737 --- /dev/null +++ b/crates/jiff-static/shared/util/array_str.rs @@ -0,0 +1,198 @@ +// auto-generated by: jiff-cli generate shared + +/// A simple and not the most-efficient ...
6
407
196
cb75cb7a577d4761426a7572cef3c618638b5bb5
Andrew Gallant
2025-03-05T23:28:53
shared: move some things around We're likely going to be moving more `crate::util` code into `crate::shared::util` (unfortunately), so split `shared/util` apart to make room for it.
diff --git a/crates/jiff-static/shared/posix.rs b/crates/jiff-static/shared/posix.rs index f8c2a44..d4645fe 100644 --- a/crates/jiff-static/shared/posix.rs +++ b/crates/jiff-static/shared/posix.rs @@ -3,7 +3,7 @@ use alloc::string::String; use super::{ - util::{Byte, Bytes}, + util::escape::{Byte, Bytes}, ...
12
122
106
8c1517b30859a1b7f85462c9c7095e97d14d296a
Andrew Gallant
2025-03-05T23:28:50
tz: reject "unreasonable" POSIX time zones outright This makes the POSIX time zone parser reject strings like `EST5EDT`. That is, a time zone with daylight saving time, but without an explicit rule stating when daylight saving time becomes active/inactive. We were already doing this, but more explicitly by calling `P...
diff --git a/src/shared/posix.rs b/src/shared/posix.rs index bcd4056..582fb0e 100644 --- a/src/shared/posix.rs +++ b/src/shared/posix.rs @@ -143,14 +143,18 @@ impl<'s> Parser<'s> { let abbrev = self .parse_abbreviation() .map_err(|e| err!("failed to parse DST abbreviation: {e}"))?; + ...
3
18
22