@feedmepos/mf-common 1.29.28 → 1.29.30

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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Locale-aware date/time formatting via Intl. Callers pass an explicit BCP-47
3
+ * locale tag (see useAppLocale) built from the app's language + the business's
4
+ * country, rather than relying on the bare device locale.
5
+ */
6
+ /**
7
+ * Formats a stored "HH:mm" value (e.g. a scheduler time-of-day) for display.
8
+ * Hour cycle follows the business's country (see getHourCycle above) unless
9
+ * `hour12` is passed explicitly, which overrides it for that one caller.
10
+ *
11
+ * Falls back to the raw input instead of throwing on a malformed "HH:mm" or
12
+ * an invalid locale tag -- this is called with API-provided data, and a bad
13
+ * value here shouldn't crash the view (dayjs.format() never threw either).
14
+ * Anchors on a fixed UTC instant + `timeZone: "UTC"` rather than "today" in
15
+ * the viewer's own zone, so a DST spring-forward gap can't turn a valid
16
+ * "HH:mm" into a nonexistent local time.
17
+ */
18
+ export declare function formatTimeOfDay(hhmm: string, locale: string, hour12?: boolean, country?: string): string;
19
+ /**
20
+ * Falls back to the input (stringified) instead of throwing on an unparsable
21
+ * date or an invalid locale tag -- same rationale as formatTimeOfDay above.
22
+ */
23
+ export declare function formatDateTime(date: Date | string | number, locale: string, opts?: Intl.DateTimeFormatOptions, country?: string): string;
24
+ /**
25
+ * Whether the business's country conventionally uses a 12-hour clock.
26
+ *
27
+ * `country` is the reliable signal (see COUNTRY_HOUR_CYCLE above) and wins
28
+ * whenever given. The old single-arg signature took a locale tag, so a
29
+ * caller passing only `locale` (not yet updated to also pass `country`)
30
+ * falls back to the previous Intl.resolvedOptions-based detection on that
31
+ * tag -- not the fix, but not a silent wrong answer either: this is the
32
+ * exact previous behavior, preserved for callers that haven't threaded
33
+ * `country` through yet.
34
+ */
35
+ export declare function prefersHour12(locale?: string, country?: string): boolean;
36
+ //# sourceMappingURL=dateTimeFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeFormat.d.ts","sourceRoot":"","sources":["../../../src/utils/dateTimeFormat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsDH;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAoBR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,EAC5B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,IAAI,CAAC,qBAAmE,EAC9E,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAoBR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAWxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-common",
3
- "version": "1.29.28",
3
+ "version": "1.29.30",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"