Bug 1825938 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The error is triggered by this code in the `throwDepError` call:
```
              this.subscriptions.push(
                this.airBoundEntries$.pipe(
                  (0, Y.M) (this.airSearchCriteria$, this.currentEntryIndex$),
                  (0, P.h) (
                    ([f, 
                    k,
                    Z]) =>0 === Z &&
                    f &&
                    f.length > 0 &&
                    f[0].airBoundGroups &&
                    f[0].airBoundGroups.length > 0 &&
                    null !== k
                  ),
                  (0, li.x) (
                    (f, k) =>f[1].id === k[1].id &&
                    f[1].bounds[0].departureDateTime === k[1].bounds[0].departureDateTime
                  )
                ).subscribe(([f,
                k]) =>{
                  this.throwDepError(k)
                })
              ),
```

Where `k` is an object with my selection:
```
bounds: [{
  departureDateTime: date: Date Thu Apr 27 2023 00:00:00 GMT-0400 (Eastern Daylight Saving Time),
  destinationLocationCode: "HND",
  originLocationCode: "ITM",
}],
cabin: "ecoBusiness",
commercialFareFamilies: [ "NONE" ],
id: "8733097b-87e6-4663-8e8f-1aba92ac03f8",
travelers: [ "1ADT", "0CHD", "0INF" ​],
type: "[AirSearchCriteria] add and select",
```

Chrome gets to the same code:
```
                throwDepError(t) {
                    if (this.fareConditions(),
                    t && t.bounds) {
                        const r = Object(t.bounds[0].departureDateTime)
                          , n = t.bounds[1] ? Object(t.bounds[1].departureDateTime) : ""
                          , o = new g.uU("en-Ja").transform(r.date, "dd-MMM-yyyy")
                          , s = new g.uU("en-Ja").transform(n.date, "dd-MMM-yyyy")
                          , l = new Date(o).getTime()
                          , d = new Date(s).getTime()
                          , p = new Date(this.configStore && this.configStore.selectedDepartureDate ? this.configStore.selectedDepartureDate : this.localConfig.selectedDepartureDate).getTime();
                        this.departureSelectionError = l < p || d < p && 0 !== d
                    }
                }
`
But `l` and `p` end up being negative values in Firefox, because they are formatting `o` and `s` to a string like `"27-Apr-2023"`

And of course, in Firefox, `new Date("27-Apr-2023")` gives a date with the year `-2023`.

Their code therefore ends up thinking the date is wrong, and shows the errors.

So this is bug 1515318.
The error is triggered by this code in the `throwDepError` call:
```
              this.subscriptions.push(
                this.airBoundEntries$.pipe(
                  (0, Y.M) (this.airSearchCriteria$, this.currentEntryIndex$),
                  (0, P.h) (
                    ([f, 
                    k,
                    Z]) =>0 === Z &&
                    f &&
                    f.length > 0 &&
                    f[0].airBoundGroups &&
                    f[0].airBoundGroups.length > 0 &&
                    null !== k
                  ),
                  (0, li.x) (
                    (f, k) =>f[1].id === k[1].id &&
                    f[1].bounds[0].departureDateTime === k[1].bounds[0].departureDateTime
                  )
                ).subscribe(([f,
                k]) =>{
                  this.throwDepError(k)
                })
              ),
```

Where `k` is an object with my selection:
```
bounds: [{
  departureDateTime: date: Date Thu Apr 27 2023 00:00:00 GMT-0400 (Eastern Daylight Saving Time),
  destinationLocationCode: "HND",
  originLocationCode: "ITM",
}],
cabin: "ecoBusiness",
commercialFareFamilies: [ "NONE" ],
id: "8733097b-87e6-4663-8e8f-1aba92ac03f8",
travelers: [ "1ADT", "0CHD", "0INF" ​],
type: "[AirSearchCriteria] add and select",
```

Chrome gets to the same code:
```
                throwDepError(t) {
                    if (this.fareConditions(),
                    t && t.bounds) {
                        const r = Object(t.bounds[0].departureDateTime)
                          , n = t.bounds[1] ? Object(t.bounds[1].departureDateTime) : ""
                          , o = new g.uU("en-Ja").transform(r.date, "dd-MMM-yyyy")
                          , s = new g.uU("en-Ja").transform(n.date, "dd-MMM-yyyy")
                          , l = new Date(o).getTime()
                          , d = new Date(s).getTime()
                          , p = new Date(this.configStore && this.configStore.selectedDepartureDate ? this.configStore.selectedDepartureDate : this.localConfig.selectedDepartureDate).getTime();
                        this.departureSelectionError = l < p || d < p && 0 !== d
                    }
                }
```
But `l` and `p` end up being negative values in Firefox, because they are formatting `o` and `s` to a string like `"27-Apr-2023"`

And of course, in Firefox, `new Date("27-Apr-2023")` gives a date with the year `-2023`.

Their code therefore ends up thinking the date is wrong, and shows the errors.

So this is bug 1515318.

Back to Bug 1825938 Comment 14