File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,26 @@ pub use self::utc::Utc;
4646/// DST.
4747/// * No result when the clock is turned forwards during a transition due to for example DST.
4848///
49+ /// <div class="warning">
50+ ///
51+ /// In wasm, when using [`Local`], only the [`LocalResult::Single`] variant is returned.
52+ /// Specifically:
53+ ///
54+ /// * When the clock is turned backwards, where `Ambiguous(earliest, latest)` would be expected,
55+ /// `Single(earliest)` is returned instead.
56+ /// * When the clock is turned forwards, where `None` would be expected, `Single(t)` is returned,
57+ /// with `t` being the requested local time represented as though there is no transition on that
58+ /// day (i.e. still "summer time")
59+ ///
60+ /// This is caused because of limitations in the JavaScript
61+ /// [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)
62+ /// API, which always parses a local time as a single, valid time - even for an
63+ /// input which describes a nonexistent or ambiguous time.
64+ ///
65+ /// See further discussion and workarounds in <https://github.com/chronotope/chrono/issues/1701>.
66+ ///
67+ /// </div>
68+ ///
4969/// When the clock is turned backwards it creates a _fold_ in local time, during which the local
5070/// time is _ambiguous_. When the clock is turned forwards it creates a _gap_ in local time, during
5171/// which the local time is _missing_, or does not exist.
You can’t perform that action at this time.
0 commit comments