@autobusal/providers 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/Setup/Preload.tsx +9 -1
- package/package.json +1 -1
- package/types/routes.ts +7 -0
- package/types/settings.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
7
7
|
> Note: 1.8.0 through 1.11.0 were published without changelog entries. The
|
|
8
8
|
> gap is left as-is rather than reconstructed after the fact.
|
|
9
9
|
|
|
10
|
+
## 1.21.0
|
|
11
|
+
|
|
12
|
+
`SettingsData.today` — the earliest bookable date as the server reckons it,
|
|
13
|
+
handed to the calendar at startup so the picker stops flooring on the buyer's
|
|
14
|
+
device clock.
|
|
15
|
+
|
|
16
|
+
## 1.20.0
|
|
17
|
+
|
|
18
|
+
`FoundData.departs_in` — minutes until departure, for same-day searches only,
|
|
19
|
+
null on every other date.
|
|
20
|
+
|
|
10
21
|
## 1.19.0
|
|
11
22
|
|
|
12
23
|
`types/reviews.ts` — `RatingData`, `ReviewData`, `ReviewSummaryData`. `rating`
|
package/Setup/Preload.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonLd } from '@autobusal/common';
|
|
1
|
+
import { JsonLd, setServerToday } from '@autobusal/common';
|
|
2
2
|
import { SettingsData } from '../types/settings';
|
|
3
3
|
import { useSystemTheme } from '@autobusal/hooks';
|
|
4
4
|
|
|
@@ -15,6 +15,14 @@ interface Props {
|
|
|
15
15
|
// fallback rendered above the router; a page's own <Meta title=...> renders
|
|
16
16
|
// deeper in the tree and correctly overrides it once data loads.
|
|
17
17
|
const Preload = ({ data, children }: Props): JSX.Element => {
|
|
18
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
19
|
+
// Hand the booking calendar the SERVER's idea of today, before anything
|
|
20
|
+
// renders one. Without it the picker floors on the buyer's device clock -
|
|
21
|
+
// so somebody in Shanghai on the 5th could not select the 4th for an
|
|
22
|
+
// Italian coach that had not left yet, on a date the server would have
|
|
23
|
+
// sold them quite happily.
|
|
24
|
+
setServerToday(data.today);
|
|
25
|
+
|
|
18
26
|
// we arrange the font family names before inserting them
|
|
19
27
|
const fontTitle = data.theme.fontFamily.title.replace(/ /g, '+');
|
|
20
28
|
const fontContent = data.theme.fontFamily.content.replace(/ /g, '+');
|
package/package.json
CHANGED
package/types/routes.ts
CHANGED
|
@@ -113,6 +113,13 @@ export interface FoundData extends Omit<RouteData, 'locations' | 'id'> {
|
|
|
113
113
|
// must read "missing" as unknown, never as direct.
|
|
114
114
|
stops_count?: number
|
|
115
115
|
// Edited: Ferjolt Ozuni - Date: 2026-08-01
|
|
116
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
117
|
+
// Minutes until this coach leaves, for TODAY's searches only - null on
|
|
118
|
+
// every other date. Computed server-side, because a countdown built from
|
|
119
|
+
// the visitor's own clock is wrong for anybody whose device is off or in
|
|
120
|
+
// another timezone, and "leaves in 20 minutes" must not be wrong.
|
|
121
|
+
departs_in?: number | null
|
|
122
|
+
|
|
116
123
|
// The operator's subscription priority, as obtapi already sends it.
|
|
117
124
|
// Used only as a tiebreak in the "recommended" ordering - see
|
|
118
125
|
// routes-order's Found/refine.ts. Absent on external-provider offers.
|
package/types/settings.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export interface SettingsData {
|
|
2
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
3
|
+
// The earliest bookable date as the SERVER reckons it, d/m/Y. The date
|
|
4
|
+
// picker floors on this rather than on the browser's clock, which is the
|
|
5
|
+
// buyer's clock and says nothing about where they are travelling.
|
|
6
|
+
today?: string
|
|
7
|
+
|
|
2
8
|
url: string
|
|
3
9
|
|
|
4
10
|
// Edited: Ferjolt Ozuni - Date: 2026-08-01
|