@flamingo-stack/openframe-frontend-core 0.0.642 → 0.0.643-snapshot.20260916153353
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/dist/chat-protocol/index.cjs +6 -3
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +6 -3
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/source-metadata.d.ts +16 -1
- package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
- package/dist/{chunk-YM6L3WM5.js → chunk-27RD5XTP.js} +3 -3
- package/dist/{chunk-POPL3W2S.js → chunk-3DGRXC74.js} +3 -3
- package/dist/{chunk-2Z5FPHOL.cjs → chunk-3UBT2OIX.cjs} +20 -20
- package/dist/{chunk-2Z5FPHOL.cjs.map → chunk-3UBT2OIX.cjs.map} +1 -1
- package/dist/{chunk-6GY6DFIH.js → chunk-4WVWRFGP.js} +6 -6
- package/dist/{chunk-OYI3K5R6.cjs → chunk-65EVGKFV.cjs} +8 -14
- package/dist/chunk-65EVGKFV.cjs.map +1 -0
- package/dist/{chunk-6NHLZORM.js → chunk-7Q5XXPCB.js} +6 -6
- package/dist/{chunk-2NRLRRMR.cjs → chunk-7R2DIGG4.cjs} +319 -293
- package/dist/chunk-7R2DIGG4.cjs.map +1 -0
- package/dist/{chunk-3LXJEXPH.js → chunk-B3Z3RJRW.js} +2 -2
- package/dist/{chunk-N5C5P2LM.cjs → chunk-B5IFXCRF.cjs} +22 -22
- package/dist/{chunk-N5C5P2LM.cjs.map → chunk-B5IFXCRF.cjs.map} +1 -1
- package/dist/{chunk-YRSRP4U3.cjs → chunk-C5Y5T6GC.cjs} +15 -15
- package/dist/{chunk-YRSRP4U3.cjs.map → chunk-C5Y5T6GC.cjs.map} +1 -1
- package/dist/{chunk-VHB3I6F3.cjs → chunk-CBXZSTAG.cjs} +419 -445
- package/dist/chunk-CBXZSTAG.cjs.map +1 -0
- package/dist/{chunk-VKPTN5MT.cjs → chunk-DCCY54LU.cjs} +6 -6
- package/dist/{chunk-VKPTN5MT.cjs.map → chunk-DCCY54LU.cjs.map} +1 -1
- package/dist/{chunk-WL3PNUNY.cjs → chunk-FAD5WURS.cjs} +81 -81
- package/dist/{chunk-WL3PNUNY.cjs.map → chunk-FAD5WURS.cjs.map} +1 -1
- package/dist/{chunk-3IPL6G7S.js → chunk-FOSIR4QF.js} +260 -234
- package/dist/chunk-FOSIR4QF.js.map +1 -0
- package/dist/{chunk-MJ424FEC.js → chunk-HOGOQA2X.js} +2 -2
- package/dist/{chunk-SDGMLXIP.js → chunk-HPWLIYRL.js} +12 -25
- package/dist/chunk-HPWLIYRL.js.map +1 -0
- package/dist/{chunk-3I6XHQUD.js → chunk-I57XLISO.js} +54 -80
- package/dist/chunk-I57XLISO.js.map +1 -0
- package/dist/{chunk-FRCUUK5X.cjs → chunk-IIXB5REN.cjs} +3 -3
- package/dist/{chunk-FRCUUK5X.cjs.map → chunk-IIXB5REN.cjs.map} +1 -1
- package/dist/{chunk-HW7BLVQH.js → chunk-IXD6SHQ6.js} +4 -4
- package/dist/{chunk-XFLJC2WR.cjs → chunk-LZYPSDFE.cjs} +59 -59
- package/dist/{chunk-XFLJC2WR.cjs.map → chunk-LZYPSDFE.cjs.map} +1 -1
- package/dist/{chunk-QY25ZP2V.cjs → chunk-MCQAOIUK.cjs} +28 -28
- package/dist/{chunk-QY25ZP2V.cjs.map → chunk-MCQAOIUK.cjs.map} +1 -1
- package/dist/{chunk-S254VEDE.js → chunk-MRIOYSXH.js} +3 -3
- package/dist/{chunk-OOOOC5O5.cjs → chunk-OMSUWB6A.cjs} +29 -29
- package/dist/{chunk-OOOOC5O5.cjs.map → chunk-OMSUWB6A.cjs.map} +1 -1
- package/dist/{chunk-GEIHTN6J.cjs → chunk-OVXYX47B.cjs} +10 -10
- package/dist/{chunk-GEIHTN6J.cjs.map → chunk-OVXYX47B.cjs.map} +1 -1
- package/dist/{chunk-XWGHLSAL.js → chunk-PFV4DAX5.js} +4 -4
- package/dist/{chunk-O4LL7RQV.cjs → chunk-RB6L5EGM.cjs} +208 -221
- package/dist/chunk-RB6L5EGM.cjs.map +1 -0
- package/dist/{chunk-M4PJVFBF.cjs → chunk-RFFF2EYD.cjs} +11 -11
- package/dist/{chunk-M4PJVFBF.cjs.map → chunk-RFFF2EYD.cjs.map} +1 -1
- package/dist/{chunk-UFBWNVZZ.js → chunk-RNMGKAS6.js} +7 -7
- package/dist/{chunk-SE6YRE3R.cjs → chunk-RWURXICE.cjs} +32 -32
- package/dist/{chunk-SE6YRE3R.cjs.map → chunk-RWURXICE.cjs.map} +1 -1
- package/dist/{chunk-ZAIYD3MZ.js → chunk-S2KMNFFN.js} +3 -3
- package/dist/{chunk-ZGPJ3NVF.js → chunk-SKABQX44.js} +3 -3
- package/dist/{chunk-YE3TFNW6.cjs → chunk-TGUA3C4U.cjs} +5 -5
- package/dist/{chunk-YE3TFNW6.cjs.map → chunk-TGUA3C4U.cjs.map} +1 -1
- package/dist/{chunk-ORFJVMAL.js → chunk-TTVOBWAH.js} +5 -11
- package/dist/chunk-TTVOBWAH.js.map +1 -0
- package/dist/{chunk-M7QROULE.js → chunk-UEXIMEVU.js} +5 -5
- package/dist/{chunk-EW3MSJOE.cjs → chunk-UKV52KAP.cjs} +33 -33
- package/dist/{chunk-EW3MSJOE.cjs.map → chunk-UKV52KAP.cjs.map} +1 -1
- package/dist/{chunk-J4RZVLLQ.js → chunk-VE52MSYC.js} +5 -5
- package/dist/components/case-studies/index.cjs +16 -16
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/chat-sidebar.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -9
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +2 -8
- package/dist/components/chat/types/entities/investor-update.d.ts.map +1 -1
- package/dist/components/chat/types/entities/program-types.d.ts +8 -18
- package/dist/components/chat/types/entities/program-types.d.ts.map +1 -1
- package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/docs/index.js +7 -7
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/help-center-pages/index.cjs +24 -24
- package/dist/components/help-center-pages/index.js +15 -15
- package/dist/components/index.cjs +53 -59
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +15 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/logs-list.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/confirmation.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/directory.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +47 -72
- package/dist/components/meeting-scheduler/index.cjs.map +1 -1
- package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.js +16 -41
- package/dist/components/meeting-scheduler/index.js.map +1 -1
- package/dist/components/meeting-scheduler/slot-picker.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/navigation/index.js +6 -6
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/article-author-byline.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/device-card.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +19 -5
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +4 -10
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +3 -9
- package/dist/components/ui/table/table-timestamp-cell.d.ts.map +1 -1
- package/dist/index.cjs +29 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -23
- package/dist/index.js.map +1 -1
- package/dist/utils/date-formatters.d.ts +7 -2
- package/dist/utils/date-formatters.d.ts.map +1 -1
- package/dist/utils/date-utils.d.ts +4 -1
- package/dist/utils/date-utils.d.ts.map +1 -1
- package/dist/utils/format-date.d.ts.map +1 -1
- package/dist/utils/format.d.ts +155 -11
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/index.cjs +223 -109
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +211 -110
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/program-instant.d.ts +145 -0
- package/dist/utils/program-instant.d.ts.map +1 -0
- package/dist/utils/program-meta-renderers.d.ts +3 -0
- package/dist/utils/program-meta-renderers.d.ts.map +1 -0
- package/dist/utils/url-safety.d.ts +33 -0
- package/dist/utils/url-safety.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +70 -3
- package/src/chat-protocol/source-metadata.ts +22 -6
- package/src/components/chat/chat-sidebar.tsx +4 -11
- package/src/components/chat/entity-cards/.program-card.md +1 -1
- package/src/components/chat/entity-cards/blog-card.tsx +4 -24
- package/src/components/chat/entity-cards/dispatch.tsx +9 -27
- package/src/components/chat/entity-cards/program-card.tsx +42 -81
- package/src/components/chat/types/entities/investor-update.ts +4 -6
- package/src/components/chat/types/entities/program-types.ts +8 -89
- package/src/components/chat/utils/.compact-card-classes.md +1 -1
- package/src/components/chat/utils/compact-card-classes.ts +5 -3
- package/src/components/logs-list.tsx +4 -13
- package/src/components/meeting-scheduler/confirmation.tsx +6 -10
- package/src/components/meeting-scheduler/directory.tsx +2 -12
- package/src/components/meeting-scheduler/index.tsx +3 -11
- package/src/components/meeting-scheduler/slot-picker.tsx +4 -7
- package/src/components/shared/article-author-byline.tsx +4 -13
- package/src/components/ui/.drawer.md +1 -0
- package/src/components/ui/__tests__/drawer-size.test.tsx +38 -0
- package/src/components/ui/date-picker.tsx +6 -13
- package/src/components/ui/device-card.tsx +4 -10
- package/src/components/ui/drawer.tsx +44 -9
- package/src/components/ui/table/table-timestamp-cell.tsx +8 -2
- package/src/utils/.format.md +5 -2
- package/src/utils/__tests__/date-rendering.test.ts +118 -0
- package/src/utils/__tests__/format-program-dates.test.ts +148 -0
- package/src/utils/__tests__/program-instant.test.ts +125 -0
- package/src/utils/__tests__/url-safety.test.ts +44 -0
- package/src/utils/date-formatters.ts +18 -29
- package/src/utils/date-utils.ts +27 -40
- package/src/utils/format-date.ts +14 -16
- package/src/utils/format.ts +367 -66
- package/src/utils/index.ts +24 -0
- package/src/utils/program-instant.ts +180 -0
- package/src/utils/program-meta-renderers.ts +18 -0
- package/src/utils/url-safety.ts +43 -0
- package/dist/chunk-2NRLRRMR.cjs.map +0 -1
- package/dist/chunk-3I6XHQUD.js.map +0 -1
- package/dist/chunk-3IPL6G7S.js.map +0 -1
- package/dist/chunk-O4LL7RQV.cjs.map +0 -1
- package/dist/chunk-ORFJVMAL.js.map +0 -1
- package/dist/chunk-OYI3K5R6.cjs.map +0 -1
- package/dist/chunk-SDGMLXIP.js.map +0 -1
- package/dist/chunk-VHB3I6F3.cjs.map +0 -1
- /package/dist/{chunk-YM6L3WM5.js.map → chunk-27RD5XTP.js.map} +0 -0
- /package/dist/{chunk-POPL3W2S.js.map → chunk-3DGRXC74.js.map} +0 -0
- /package/dist/{chunk-6GY6DFIH.js.map → chunk-4WVWRFGP.js.map} +0 -0
- /package/dist/{chunk-6NHLZORM.js.map → chunk-7Q5XXPCB.js.map} +0 -0
- /package/dist/{chunk-3LXJEXPH.js.map → chunk-B3Z3RJRW.js.map} +0 -0
- /package/dist/{chunk-MJ424FEC.js.map → chunk-HOGOQA2X.js.map} +0 -0
- /package/dist/{chunk-HW7BLVQH.js.map → chunk-IXD6SHQ6.js.map} +0 -0
- /package/dist/{chunk-S254VEDE.js.map → chunk-MRIOYSXH.js.map} +0 -0
- /package/dist/{chunk-XWGHLSAL.js.map → chunk-PFV4DAX5.js.map} +0 -0
- /package/dist/{chunk-UFBWNVZZ.js.map → chunk-RNMGKAS6.js.map} +0 -0
- /package/dist/{chunk-ZAIYD3MZ.js.map → chunk-S2KMNFFN.js.map} +0 -0
- /package/dist/{chunk-ZGPJ3NVF.js.map → chunk-SKABQX44.js.map} +0 -0
- /package/dist/{chunk-M7QROULE.js.map → chunk-UEXIMEVU.js.map} +0 -0
- /package/dist/{chunk-J4RZVLLQ.js.map → chunk-VE52MSYC.js.map} +0 -0
package/dist/utils/format.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility functions for formatting data
|
|
3
3
|
*/
|
|
4
|
+
import type { ProgramInstant } from './program-instant';
|
|
4
5
|
/**
|
|
5
6
|
* Format a date to a human-readable string
|
|
6
7
|
* @param date - The date to format (Date object or ISO string)
|
|
@@ -120,24 +121,121 @@ export declare function formatDurationMMSS(seconds: number | null | undefined):
|
|
|
120
121
|
*/
|
|
121
122
|
export declare function formatDurationCompact(seconds: number | null | undefined): string;
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
+
* THE date/time renderer. Every date or time this package presents goes through
|
|
125
|
+
* `formatDateWithTimezone` (or its clock sibling `formatTimeWithTimezone`) — the
|
|
126
|
+
* named helpers below are presets over it, not separate implementations.
|
|
124
127
|
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* (
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* The zone LABEL is rendered separately by callers, so it is never appended here.
|
|
128
|
+
* Why one: each helper used to decide the zone for itself — `timeZone: 'UTC'`
|
|
129
|
+
* here, none at all there (so the MACHINE's zone), hand-built `MM/DD/YYYY` from
|
|
130
|
+
* `getUTC*` getters, month names looked up in an array — and the answers
|
|
131
|
+
* disagreed. A date rendered without an explicit zone is a different day on the
|
|
132
|
+
* server (Vercel = UTC) than in a browser west of it, which is both a wrong day
|
|
133
|
+
* and a React #418 hydration mismatch. The zone is therefore a REQUIRED decision
|
|
134
|
+
* at every call, made in exactly one of three ways:
|
|
133
135
|
*
|
|
134
|
-
*
|
|
136
|
+
* - an IANA zone (`'America/New_York'`): a record that HAS a zone renders in it
|
|
137
|
+
* — an event's wall clock is the event's, whoever is looking;
|
|
138
|
+
* - `null` / `undefined`: pinned to UTC — content dates (published, released,
|
|
139
|
+
* periods) that must read the same on the server and every client;
|
|
140
|
+
* - `VIEWER_TIMEZONE`: the runtime's own zone — ONLY for client-rendered UI whose
|
|
141
|
+
* whole meaning is "your local time" (a date picker, a booking slot in the
|
|
142
|
+
* visitor's zone, a "last active" stamp in an app shell).
|
|
143
|
+
*
|
|
144
|
+
* An unresolvable zone (legacy data) degrades to UTC rather than throwing, so a
|
|
145
|
+
* bad row cannot take down the surface rendering it.
|
|
146
|
+
*/
|
|
147
|
+
export declare const VIEWER_TIMEZONE = "viewer";
|
|
148
|
+
type DateInput = Date | string | number | null | undefined;
|
|
149
|
+
/** The shapes this package renders, by name. A raw `Intl` field set is also
|
|
150
|
+
* accepted for a one-off shape; the ZONE is never taken from it — it is the
|
|
151
|
+
* explicit `timezone` argument, so no caller can smuggle a default back in. */
|
|
152
|
+
export type ZonedDateStyle = 'medium' | 'weekday' | 'long' | 'numeric' | 'monthYear' | 'monthYearShort' | 'numericDateTime' | 'mediumDateTime' | 'weekdayDateTimeZoned' | 'shortWeekdayDateTime' | 'numericDateTime24h' | 'localeDateTime';
|
|
153
|
+
/**
|
|
154
|
+
* Render a date (and, for a date-time style, its time) in an explicit zone.
|
|
155
|
+
* Returns `''` for a missing or unparseable value.
|
|
156
|
+
*
|
|
157
|
+
* `options.viewerLocale` renders in the runtime's own LOCALE instead of the
|
|
158
|
+
* fixed `en-US` — for client-only UI that should read the way its user writes
|
|
159
|
+
* dates. The locale is never implied, for the same hydration reason as the zone.
|
|
160
|
+
*/
|
|
161
|
+
export declare function formatDateWithTimezone(date: DateInput, timezone?: string | null, style?: ZonedDateStyle | Intl.DateTimeFormatOptions, options?: {
|
|
162
|
+
viewerLocale?: boolean;
|
|
163
|
+
}): string;
|
|
164
|
+
/**
|
|
165
|
+
* `2026/03/19, 21:18` — a sortable, locale-independent date-time for dense
|
|
166
|
+
* operator UI (log lines, device "last seen").
|
|
167
|
+
*
|
|
168
|
+
* No locale renders this shape, so it is assembled from `formatToParts` of the
|
|
169
|
+
* SAME formatter every other date uses: the zone decision cannot drift from the
|
|
170
|
+
* rest of the package. It replaces two copies that built the string by hand from
|
|
171
|
+
* `getUTC*` getters and printed `NaN/NaN/NaN` for an unparseable value.
|
|
172
|
+
*/
|
|
173
|
+
export declare function formatDateTimeYmd(date: DateInput, timezone?: string | null, options?: {
|
|
174
|
+
separator?: string;
|
|
175
|
+
}): string;
|
|
176
|
+
/**
|
|
177
|
+
* A wall-clock time in an explicit zone — the clock sibling of
|
|
178
|
+
* `formatDateWithTimezone`, rendered by it, so the pair cannot disagree about
|
|
179
|
+
* which zone a date and the time beside it are stated in.
|
|
180
|
+
*
|
|
181
|
+
* `withZoneLabel` appends the short zone name ("4:00 PM EDT") for plain joined
|
|
182
|
+
* strings where there is no room for a separately styled label.
|
|
183
|
+
*
|
|
184
|
+
* Returns: "4:00 PM", or "4:00 PM EDT" with `withZoneLabel`.
|
|
185
|
+
*/
|
|
186
|
+
export declare function formatTimeWithTimezone(date: DateInput, timezone?: string | null, options?: {
|
|
187
|
+
withZoneLabel?: boolean;
|
|
188
|
+
viewerLocale?: boolean;
|
|
189
|
+
}): string;
|
|
190
|
+
/**
|
|
191
|
+
* THE program date — the date half of what `formatWebinarTimeMeta` renders as
|
|
192
|
+
* the time half, taking the same already-resolved `ProgramInstant` so the two
|
|
193
|
+
* cannot name different moments.
|
|
194
|
+
*
|
|
195
|
+
* Every program surface used to write this branch itself:
|
|
196
|
+
* `zoned.instant ? formatDateWithTimezone(...) :
|
|
197
|
+
* formatUtc(new Date(item.date), 'EEEE d MMMM')` — four copies, and they did
|
|
198
|
+
* not agree. Three stated the condition off the resolved instant and the
|
|
199
|
+
* fourth off a local timezone variable; worse, the two branches rendered
|
|
200
|
+
* DIFFERENT SHAPES, so whether a row happened to declare a zone decided
|
|
201
|
+
* whether its headline read "Thursday, March 19" or "Thursday 19 March".
|
|
202
|
+
*
|
|
203
|
+
* There is no UTC branch here because there never needed to be one:
|
|
204
|
+
* `formatDateWithTimezone` already pins to UTC when handed no zone, which is
|
|
205
|
+
* the same React #418 fix the hand-rolled `formatUtc` twins existed for — they
|
|
206
|
+
* were a date-fns re-implementation of a fallback that was already inside the
|
|
207
|
+
* function they sat next to.
|
|
135
208
|
*/
|
|
136
|
-
export declare function
|
|
209
|
+
export declare function formatProgramDate(at: ProgramInstant, style?: ZonedDateStyle): string;
|
|
210
|
+
/**
|
|
211
|
+
* Do these two endpoints describe a forward-running interval?
|
|
212
|
+
*
|
|
213
|
+
* THE ordering rule for every renderer in this file. A range that runs
|
|
214
|
+
* backwards is not a short range, it is a false one: a card shipped "-45m"
|
|
215
|
+
* from a row whose `end_at` preceded its `start_at`, and the clock renderer
|
|
216
|
+
* printed "11:00 PM - 9:00 PM" from the same shape. Both refuse it here.
|
|
217
|
+
*
|
|
218
|
+
* The host app enforces the same rule at INGEST (it drops such an `end_at`
|
|
219
|
+
* rather than storing it) and states the comparison itself, because the module
|
|
220
|
+
* that owns it there is a dependency-free leaf its mapper tests rely on. Two
|
|
221
|
+
* statements of one comparison, across a package boundary, knowingly — if this
|
|
222
|
+
* one changes, that one has to.
|
|
223
|
+
*/
|
|
224
|
+
export declare function isOrderedRange(from: Date | string | null | undefined, to: Date | string | null | undefined): boolean;
|
|
137
225
|
/**
|
|
138
226
|
* Calculate and format duration between two timestamps
|
|
139
227
|
* Used for webinar durations
|
|
140
228
|
* Returns: "1h 30m" or "45m"
|
|
229
|
+
*
|
|
230
|
+
* Returns `''` — the same "nothing to show" this function already returns for a
|
|
231
|
+
* missing endpoint — when the range is not a positive, real duration. An event
|
|
232
|
+
* whose `end_at` precedes its `start_at` is corrupt data, and the unguarded
|
|
233
|
+
* subtraction printed it literally: a live webinar row rendered "-45m" on the
|
|
234
|
+
* card. An unparseable timestamp printed "NaNm" the same way. A renderer shows
|
|
235
|
+
* nothing rather than an impossible value; the write path is what must reject
|
|
236
|
+
* the row. (Note the negative case never even reached the `>= 60` branch, so
|
|
237
|
+
* -90 minutes rendered as "-90m" rather than "-1h 30m" — the output was not
|
|
238
|
+
* just wrong, it was inconsistently wrong.)
|
|
141
239
|
*/
|
|
142
240
|
export declare function formatDurationFromRange(startAt: string | Date | null | undefined, endAt: string | Date | null | undefined): string;
|
|
143
241
|
/**
|
|
@@ -302,4 +400,50 @@ export declare function formatPricingModel(pricingModel: string): string;
|
|
|
302
400
|
* plain text passthrough, and null/undefined values.
|
|
303
401
|
*/
|
|
304
402
|
export declare function formatBioText(aboutHtml: string | null | undefined, fallback?: string): string;
|
|
403
|
+
/**
|
|
404
|
+
* THE program CLOCK — one time, or a start–end range, in the resolved zone.
|
|
405
|
+
*
|
|
406
|
+
* The third member of the set beside `formatProgramDate` (the day) and
|
|
407
|
+
* `formatWebinarTimeMeta` (time + duration), and it exists because the page
|
|
408
|
+
* header rebuilt it locally: an `instant ?? utcDate` fallback and a
|
|
409
|
+
* zone-labelled render — the same things the meta
|
|
410
|
+
* helper owns, re-applied at the call site, which is exactly what that
|
|
411
|
+
* helper's docblock says goes wrong. The header also appended the RAW IANA
|
|
412
|
+
* name while the slot beneath it used the short name, so one component
|
|
413
|
+
* printed "America/New_York" and "EDT" six lines apart.
|
|
414
|
+
*
|
|
415
|
+
* Only the LAST clock carries the zone label, so a range reads
|
|
416
|
+
* "9:00 AM - 5:00 PM EDT" rather than labelling both ends.
|
|
417
|
+
*/
|
|
418
|
+
export declare function formatProgramTimeRange(at: ProgramInstant, opts?: {
|
|
419
|
+
startAt?: string | null;
|
|
420
|
+
endAt?: string | null;
|
|
421
|
+
withZoneLabel?: boolean;
|
|
422
|
+
}): string;
|
|
423
|
+
/**
|
|
424
|
+
* "4:00 PM EDT · 45m" — a webinar's time and duration as one meta string.
|
|
425
|
+
*
|
|
426
|
+
* Extracted because this exact three-line composition existed in the chat card
|
|
427
|
+
* and the public page header, and they DRIFTED: the card was corrected to read
|
|
428
|
+
* the resolved display instant while the page still read the raw `start_at`.
|
|
429
|
+
*
|
|
430
|
+
* The split is the point: the TIME comes from the resolved `instant`, the
|
|
431
|
+
* DURATION from `startAt`/`endAt`, because elapsed time is not a display date.
|
|
432
|
+
* Both sides of the separator are gated, so neither a suppressed duration nor
|
|
433
|
+
* an unrenderable time can leave one dangling.
|
|
434
|
+
*
|
|
435
|
+
* It takes the RESOLVED `ProgramInstant`, exactly as `formatProgramDate` does.
|
|
436
|
+
* While it took `instant` / `timezone` as
|
|
437
|
+
* loose fields, all four callers re-projected them off the same resolved value
|
|
438
|
+
* and no two projections matched — so a zoneless webinar rendered "4:00 PM UTC"
|
|
439
|
+
* on the public card and "4:00 PM" on the chat card, which exist to mirror each
|
|
440
|
+
* other, and the detail page fell back to a different source instant from the
|
|
441
|
+
* card's. Taking the value whole is what makes those disagreements unsayable.
|
|
442
|
+
*/
|
|
443
|
+
export declare function formatWebinarTimeMeta(at: ProgramInstant, opts: {
|
|
444
|
+
startAt: string | null;
|
|
445
|
+
endAt: string | null;
|
|
446
|
+
withZoneLabel?: boolean;
|
|
447
|
+
}): string;
|
|
448
|
+
export {};
|
|
305
449
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;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