Skip to content

chore(deps): Switch from chrono to jiff for datetime support. - #288

Merged
jetuk merged 1 commit into
mainfrom
switch-chrono-jiff
Aug 6, 2026
Merged

chore(deps): Switch from chrono to jiff for datetime support.#288
jetuk merged 1 commit into
mainfrom
switch-chrono-jiff

Conversation

@jetuk

@jetuk jetuk commented Aug 5, 2026

Copy link
Copy Markdown
Member

Chrono is being soft-deprecated and most of the ecosystem
moving to jiff.

BREAKING CHANGE: Public DataType removed. Timestepper now uses
Datetime from jiff directly.

@jetuk
jetuk requested a review from Batch21 August 5, 2026 14:25
Chrono is being soft-deprecated and most of the ecosystem
moving to jiff.

BREAKING CHANGE: Public `DataType` removed. Timestepper now uses
`Datetime` from jiff directly.
@jetuk
jetuk force-pushed the switch-chrono-jiff branch from ab28952 to 3539b5a Compare August 5, 2026 15:25
@jetuk

jetuk commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

I have realised that by removing DateType this will not round-trip the start / end date quite the same as before. The time component becomes 00::00::00 when not present on deserialisation, but is then explicitly serialised. I.e. the fact it was not present is lost. Not sure if that is problem.

One difference with Chrono is that jiff::civil::Date will successfully parse a date-time string dropping the time component. Therefore the previous approach of trying a date only, and then falling back to date-time will not work. It is either the implementation above, or a custom deserialisation (possibly using jiff's Pieces to work out if a time component was provided. The same issue will be present in Pywr v2 if that is moved to jiff.

@jetuk
jetuk merged commit 2844017 into main Aug 6, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants