Skip to content

fix(config): handle ambiguous local midnight - #639

Merged
bootandy merged 1 commit into
bootandy:masterfrom
mostafahagras:fix/ambiguous-local-midnight
Nov 1, 2026
Merged

bootandy merged 1 commit into
bootandy:masterfrom
mostafahagras:fix/ambiguous-local-midnight

Conversation

@mostafahagras

Copy link
Copy Markdown
Contributor

Problem

In Africa/Cairo on 2026-10-30, local midnight was ambiguous:

Dust panicked while resolving the start of the current day:

❯ TZ=Africa/Cairo dust

thread 'main' (5079907) panicked at /Users/mostafa/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/du-dust-1.2.6/src/config.rs:200:10:
Ambiguous local time, ranging from 2026-10-30T00:00:00+02:00 to 2026-10-30T00:00:00+03:00
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It also caused config::tests::test_get_current_date_epoch_seconds to fail in my local checkout.

Fix

Use Chrono's earliest matching instant for ambiguous local midnight.

Verification

  • TZ=Africa/Cairo cargo test passes.
  • TZ=Africa/Cairo cargo run runs without panicking.

@bootandy
bootandy merged commit c05d2b2 into bootandy:master Nov 1, 2026
18 of 19 checks passed
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