1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use ;
/// Overrides the "local timezone offset" (in minutes) for the current thread.
///
/// Mermaid (notably Gantt) follows JavaScript local-time semantics in several places, which can
/// make fixtures produce different snapshot outputs on CI runners in different timezones.
///
/// This helper provides a minimally invasive mechanism: during the closure, treat "local time" as
/// a fixed `FixedOffset` for deterministic, reproducible snapshots. `None` uses the system
/// `chrono::Local` timezone when the `host-clock` feature is enabled, and UTC otherwise.
/// Interprets a local `NaiveDateTime` as an absolute instant in the active local timezone.
///
/// When `with_fixed_local_offset_minutes(Some(x))` is active, the fixed offset is used. Otherwise,
/// the system local timezone is used when `host-clock` is enabled, and UTC otherwise.
/// Maps an absolute instant to the active local timezone (as a `FixedOffset`).
///
/// When `with_fixed_local_offset_minutes(Some(x))` is active, the fixed offset is used. Otherwise,
/// the system local timezone is used when `host-clock` is enabled, and UTC otherwise.
/// Returns the `NaiveDateTime` for an absolute instant under the active local-time semantics.
/// Returns the UTC fixed offset without fallible construction.