@gomusdev/web-components 4.13.0 → 4.13.1

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/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.13.1 (2026-07-28)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **i18n:** format times and dates per shop.locale with shared presets
8
+
3
9
  ## 4.13.0 (2026-07-28)
4
10
 
5
11
  ### Features
@@ -11113,9 +11113,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11113
11113
  if (time) ({hour: hour, minute: minute, second: second, millisecond: millisecond} = time);
11114
11114
  return new $2aaf608024c21ca1$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
11115
11115
  }
11116
- function $d07e34cce18680fd$export$d33f79e3ffc3dc83(dateTime) {
11117
- return new $2aaf608024c21ca1$export$680ea196effce5f(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
11118
- }
11119
11116
  function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
11120
11117
  if ($ad063034c8620db8$export$dbc69fd56b53d5e(date.calendar, calendar)) return date;
11121
11118
  let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
@@ -11273,14 +11270,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11273
11270
  time.millisecond += duration.milliseconds || 0;
11274
11271
  return $435a2ceaa8778ed8$var$balanceTime(time);
11275
11272
  }
11276
- function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
11277
- let res = time.copy();
11278
- $435a2ceaa8778ed8$var$addTimeFields(res, duration);
11279
- return res;
11280
- }
11281
- function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
11282
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
11283
- }
11284
11273
  function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
11285
11274
  let mutable = value.copy();
11286
11275
  switch (field) {
@@ -11562,46 +11551,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11562
11551
  return $ad063034c8620db8$export$68781ddf31c0090f(this, b);
11563
11552
  }
11564
11553
  };
11565
- var $2aaf608024c21ca1$export$680ea196effce5f = class $2aaf608024c21ca1$export$680ea196effce5f {
11566
- #type;
11567
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
11568
- this.hour = hour;
11569
- this.minute = minute;
11570
- this.second = second;
11571
- this.millisecond = millisecond;
11572
- $435a2ceaa8778ed8$export$7555de1e070510cb(this);
11573
- }
11574
- /** Returns a copy of this time. */ copy() {
11575
- return new $2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
11576
- }
11577
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
11578
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(this, duration);
11579
- }
11580
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
11581
- return $435a2ceaa8778ed8$export$fe34d3a381cd7501(this, duration);
11582
- }
11583
- /**
11584
- * Returns a new `Time` with the given fields set to the provided values. Other fields will be
11585
- * constrained accordingly.
11586
- */ set(fields) {
11587
- return $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(this, fields);
11588
- }
11589
- /**
11590
- * Returns a new `Time` with the given field adjusted by a specified amount.
11591
- * When the resulting value reaches the limits of the field, it wraps around.
11592
- */ cycle(field, amount, options) {
11593
- return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(this, field, amount, options);
11594
- }
11595
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
11596
- return $58246871e4652552$export$f59dee82248f5ad4(this);
11597
- }
11598
- /**
11599
- * Compares this time with another. A negative result indicates that this time is before the given
11600
- * one, and a positive time indicates that it is after.
11601
- */ compare(b) {
11602
- return $ad063034c8620db8$export$c19a80a9721b80f6(this, b);
11603
- }
11604
- };
11605
11554
  var $2aaf608024c21ca1$export$ca871e8dbb80966f = class $2aaf608024c21ca1$export$ca871e8dbb80966f {
11606
11555
  #type;
11607
11556
  constructor(...args) {
@@ -11826,19 +11775,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11826
11775
  }
11827
11776
  //#endregion
11828
11777
  //#region ../../packages/gomus-types/lib/helpers/utils.ts
11829
- function formatTime(value) {
11830
- return $d07e34cce18680fd$export$d33f79e3ffc3dc83($58246871e4652552$export$5adfdab05168c219(value, "Europe/Berlin")).toString().slice(0, -3);
11778
+ /** Named date presets — the single place defining what each rendering means (WI 151). */
11779
+ var DATE_FORMAT_PRESETS = {
11780
+ dayMonth: {
11781
+ month: "numeric",
11782
+ day: "numeric"
11783
+ },
11784
+ short: {
11785
+ year: "numeric",
11786
+ month: "numeric",
11787
+ day: "numeric"
11788
+ }
11789
+ };
11790
+ function formatTime(value, locale) {
11791
+ const zoned = $58246871e4652552$export$5adfdab05168c219(value, "Europe/Berlin");
11792
+ return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
11793
+ timeZone: zoned.timeZone,
11794
+ hour: "numeric",
11795
+ minute: "numeric"
11796
+ }).format(zoned.toDate());
11831
11797
  }
11832
- function formatDate(isoDateString, options = {
11833
- weekday: "long",
11834
- year: "numeric",
11835
- month: "long",
11836
- day: "numeric"
11837
- }, locale = "de") {
11798
+ function formatDate(isoDateString, preset, locale) {
11838
11799
  const zoned = $58246871e4652552$export$5adfdab05168c219(isoDateString instanceof Date ? isoDateString.toISOString() : isoDateString, "Europe/Berlin");
11839
11800
  return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
11840
11801
  timeZone: zoned.timeZone,
11841
- ...options
11802
+ ...DATE_FORMAT_PRESETS[preset]
11842
11803
  }).format(zoned.toDate());
11843
11804
  }
11844
11805
  //#endregion
@@ -13830,7 +13791,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13830
13791
  return "https://" + this.shopDomain;
13831
13792
  }
13832
13793
  get locale() {
13833
- return get$2(this.#data).locale;
13794
+ return get$2(this.#data).locale ?? "de";
13795
+ }
13796
+ formatTime(value) {
13797
+ return formatTime(value, this.locale);
13798
+ }
13799
+ formatDate(value, preset) {
13800
+ return formatDate(value, preset, this.locale);
13834
13801
  }
13835
13802
  get shop() {
13836
13803
  return this.fetchAndCache("/api/v4/shop", "shop", "shop");
@@ -15566,10 +15533,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15566
15533
  template_effect(($0, $1) => {
15567
15534
  set_text(text_2, $0);
15568
15535
  set_text(text_3, $1);
15569
- }, [() => formatDate(cartItem().time, {
15570
- month: "numeric",
15571
- day: "numeric"
15572
- }, shop.locale), () => formatTime(cartItem().time)]);
15536
+ }, [() => shop.formatDate(cartItem().time, "dayMonth"), () => shop.formatTime(cartItem().time)]);
15573
15537
  append($$anchor, fragment_1);
15574
15538
  };
15575
15539
  if_block(node, ($$render) => {
@@ -15628,16 +15592,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15628
15592
  var span_3 = root_1$19();
15629
15593
  var text_3 = child(span_3, true);
15630
15594
  reset(span_3);
15631
- template_effect(($0) => set_text(text_3, $0), [() => formatTime(cartItem().time)]);
15595
+ template_effect(($0) => set_text(text_3, $0), [() => shop.formatTime(cartItem().time)]);
15632
15596
  append($$anchor, span_3);
15633
15597
  };
15634
15598
  if_block(node_2, ($$render) => {
15635
15599
  if (cartItem().product.type === "Ticket" && cartItem().product.subtype === "timeslot") $$render(consequent_1);
15636
15600
  });
15637
- template_effect(($0) => set_text(text_2, $0), [() => formatDate(cartItem().time, {
15638
- month: "numeric",
15639
- day: "numeric"
15640
- }, shop.locale)]);
15601
+ template_effect(($0) => set_text(text_2, $0), [() => shop.formatDate(cartItem().time, "dayMonth")]);
15641
15602
  append($$anchor, fragment_1);
15642
15603
  };
15643
15604
  if_block(node_1, ($$render) => {
@@ -15662,12 +15623,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15662
15623
  if (!cartItem().time) return null;
15663
15624
  try {
15664
15625
  return {
15665
- date: formatDate(cartItem().time, {
15666
- year: "numeric",
15667
- month: "numeric",
15668
- day: "numeric"
15669
- }, shop.locale),
15670
- time: formatTime(cartItem().time)
15626
+ date: shop.formatDate(cartItem().time, "short"),
15627
+ time: shop.formatTime(cartItem().time)
15671
15628
  };
15672
15629
  } catch {
15673
15630
  return {
@@ -18143,12 +18100,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18143
18100
  * the visible row title: event rows compose it from event_title + time because a
18144
18101
  * flat-price event's price row carries no title (the row IS the event) — naming
18145
18102
  * the control from product.title alone left it unnamed (WI #141).
18103
+ *
18104
+ * Locale comes in as a parameter — shared/ components stay store-agnostic (WI #151).
18146
18105
  */
18147
- function quantityLabel(item) {
18106
+ function quantityLabel(item, locale) {
18148
18107
  const { product } = item;
18149
18108
  return isEventTicket(product) ? [
18150
18109
  product.event_title,
18151
- item.time && formatTime(item.time),
18110
+ item.time && formatTime(item.time, locale),
18152
18111
  product.title
18153
18112
  ].filter(Boolean).join(" - ") : product.title;
18154
18113
  }
@@ -18313,7 +18272,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18313
18272
  var alternate_1 = ($$anchor) => {
18314
18273
  {
18315
18274
  let $0 = /* @__PURE__ */ user_derived(() => displayItem().quantity ?? 0);
18316
- let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem()));
18275
+ let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem(), shop.locale));
18317
18276
  QuantityControl($$anchor, {
18318
18277
  get value() {
18319
18278
  return get$2($0);
@@ -36508,10 +36467,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
36508
36467
  template_effect(($0, $1) => {
36509
36468
  set_text(text_1, $0);
36510
36469
  set_text(text_2, $1);
36511
- }, [() => formatDate(item().attributes.start_time, {
36512
- month: "numeric",
36513
- day: "numeric"
36514
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36470
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36515
36471
  append($$anchor, fragment);
36516
36472
  };
36517
36473
  if_block(node, ($$render) => {
@@ -36654,20 +36610,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
36654
36610
  template_effect(($0, $1) => {
36655
36611
  set_text(text_3, $0);
36656
36612
  set_text(text_4, $1);
36657
- }, [() => formatDate(item().attributes.start_time, {
36658
- month: "numeric",
36659
- day: "numeric"
36660
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36613
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36661
36614
  append($$anchor, fragment_4);
36662
36615
  };
36663
36616
  var consequent_2 = ($$anchor) => {
36664
36617
  var span_5 = root_3$3();
36665
36618
  var text_5 = child(span_5, true);
36666
36619
  reset(span_5);
36667
- template_effect(($0) => set_text(text_5, $0), [() => formatDate(item().attributes.start_time, {
36668
- month: "numeric",
36669
- day: "numeric"
36670
- }, shop.locale)]);
36620
+ template_effect(($0) => set_text(text_5, $0), [() => shop.formatDate(item().attributes.start_time, "dayMonth")]);
36671
36621
  append($$anchor, span_5);
36672
36622
  };
36673
36623
  if_block(node_5, ($$render) => {
@@ -36859,10 +36809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
36859
36809
  template_effect(($0, $1) => {
36860
36810
  set_text(text_2, $0);
36861
36811
  set_text(text_3, $1);
36862
- }, [() => formatDate(item().attributes.start_time, {
36863
- month: "numeric",
36864
- day: "numeric"
36865
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36812
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36866
36813
  append($$anchor, fragment);
36867
36814
  };
36868
36815
  if_block(node, ($$render) => {
@@ -37636,7 +37583,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
37636
37583
  template_effect(($0) => {
37637
37584
  set_text(text, `${item().product.event_title ?? ""} - ${$0 ?? ""}`);
37638
37585
  set_text(text_1, item().product.title);
37639
- }, [() => formatTime(item().time)]);
37586
+ }, [() => shop.formatTime(item().time)]);
37640
37587
  append($$anchor, fragment);
37641
37588
  };
37642
37589
  const default_title = ($$anchor) => {
@@ -37745,7 +37692,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
37745
37692
  var li_6 = sibling(li_5, 2);
37746
37693
  var node_5 = child(li_6);
37747
37694
  {
37748
- let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item()));
37695
+ let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item(), shop.locale));
37749
37696
  QuantityControl(node_5, {
37750
37697
  get value() {
37751
37698
  return item().quantity;
@@ -37923,7 +37870,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
37923
37870
  this.timeslots = quotaManager.timeslotsOn(date, this.tsd?.timeslotTicketIds).map((x) => ({
37924
37871
  ...x,
37925
37872
  startAt: x.timeSlot,
37926
- timeFormatted: x.timeSlot.substring(11, 16),
37873
+ timeFormatted: shop.formatTime(x.timeSlot),
37927
37874
  available: x.capacity > 0
37928
37875
  }));
37929
37876
  }
@@ -11112,9 +11112,6 @@ function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
11112
11112
  if (time) ({hour: hour, minute: minute, second: second, millisecond: millisecond} = time);
11113
11113
  return new $2aaf608024c21ca1$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
11114
11114
  }
11115
- function $d07e34cce18680fd$export$d33f79e3ffc3dc83(dateTime) {
11116
- return new $2aaf608024c21ca1$export$680ea196effce5f(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
11117
- }
11118
11115
  function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
11119
11116
  if ($ad063034c8620db8$export$dbc69fd56b53d5e(date.calendar, calendar)) return date;
11120
11117
  let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
@@ -11272,14 +11269,6 @@ function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
11272
11269
  time.millisecond += duration.milliseconds || 0;
11273
11270
  return $435a2ceaa8778ed8$var$balanceTime(time);
11274
11271
  }
11275
- function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
11276
- let res = time.copy();
11277
- $435a2ceaa8778ed8$var$addTimeFields(res, duration);
11278
- return res;
11279
- }
11280
- function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
11281
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
11282
- }
11283
11272
  function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
11284
11273
  let mutable = value.copy();
11285
11274
  switch (field) {
@@ -11561,46 +11550,6 @@ var $2aaf608024c21ca1$export$99faa760c7908e4f = class $2aaf608024c21ca1$export$9
11561
11550
  return $ad063034c8620db8$export$68781ddf31c0090f(this, b);
11562
11551
  }
11563
11552
  };
11564
- var $2aaf608024c21ca1$export$680ea196effce5f = class $2aaf608024c21ca1$export$680ea196effce5f {
11565
- #type;
11566
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
11567
- this.hour = hour;
11568
- this.minute = minute;
11569
- this.second = second;
11570
- this.millisecond = millisecond;
11571
- $435a2ceaa8778ed8$export$7555de1e070510cb(this);
11572
- }
11573
- /** Returns a copy of this time. */ copy() {
11574
- return new $2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
11575
- }
11576
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
11577
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(this, duration);
11578
- }
11579
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
11580
- return $435a2ceaa8778ed8$export$fe34d3a381cd7501(this, duration);
11581
- }
11582
- /**
11583
- * Returns a new `Time` with the given fields set to the provided values. Other fields will be
11584
- * constrained accordingly.
11585
- */ set(fields) {
11586
- return $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(this, fields);
11587
- }
11588
- /**
11589
- * Returns a new `Time` with the given field adjusted by a specified amount.
11590
- * When the resulting value reaches the limits of the field, it wraps around.
11591
- */ cycle(field, amount, options) {
11592
- return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(this, field, amount, options);
11593
- }
11594
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
11595
- return $58246871e4652552$export$f59dee82248f5ad4(this);
11596
- }
11597
- /**
11598
- * Compares this time with another. A negative result indicates that this time is before the given
11599
- * one, and a positive time indicates that it is after.
11600
- */ compare(b) {
11601
- return $ad063034c8620db8$export$c19a80a9721b80f6(this, b);
11602
- }
11603
- };
11604
11553
  var $2aaf608024c21ca1$export$ca871e8dbb80966f = class $2aaf608024c21ca1$export$ca871e8dbb80966f {
11605
11554
  #type;
11606
11555
  constructor(...args) {
@@ -11825,19 +11774,31 @@ function $12a3c853105e5a70$var$getResolvedHourCycle(locale, options) {
11825
11774
  }
11826
11775
  //#endregion
11827
11776
  //#region ../../packages/gomus-types/lib/helpers/utils.ts
11828
- function formatTime(value) {
11829
- return $d07e34cce18680fd$export$d33f79e3ffc3dc83($58246871e4652552$export$5adfdab05168c219(value, "Europe/Berlin")).toString().slice(0, -3);
11777
+ /** Named date presets — the single place defining what each rendering means (WI 151). */
11778
+ var DATE_FORMAT_PRESETS = {
11779
+ dayMonth: {
11780
+ month: "numeric",
11781
+ day: "numeric"
11782
+ },
11783
+ short: {
11784
+ year: "numeric",
11785
+ month: "numeric",
11786
+ day: "numeric"
11787
+ }
11788
+ };
11789
+ function formatTime(value, locale) {
11790
+ const zoned = $58246871e4652552$export$5adfdab05168c219(value, "Europe/Berlin");
11791
+ return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
11792
+ timeZone: zoned.timeZone,
11793
+ hour: "numeric",
11794
+ minute: "numeric"
11795
+ }).format(zoned.toDate());
11830
11796
  }
11831
- function formatDate(isoDateString, options = {
11832
- weekday: "long",
11833
- year: "numeric",
11834
- month: "long",
11835
- day: "numeric"
11836
- }, locale = "de") {
11797
+ function formatDate(isoDateString, preset, locale) {
11837
11798
  const zoned = $58246871e4652552$export$5adfdab05168c219(isoDateString instanceof Date ? isoDateString.toISOString() : isoDateString, "Europe/Berlin");
11838
11799
  return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
11839
11800
  timeZone: zoned.timeZone,
11840
- ...options
11801
+ ...DATE_FORMAT_PRESETS[preset]
11841
11802
  }).format(zoned.toDate());
11842
11803
  }
11843
11804
  //#endregion
@@ -13829,7 +13790,13 @@ var Shop = class {
13829
13790
  return "https://" + this.shopDomain;
13830
13791
  }
13831
13792
  get locale() {
13832
- return get$2(this.#data).locale;
13793
+ return get$2(this.#data).locale ?? "de";
13794
+ }
13795
+ formatTime(value) {
13796
+ return formatTime(value, this.locale);
13797
+ }
13798
+ formatDate(value, preset) {
13799
+ return formatDate(value, preset, this.locale);
13833
13800
  }
13834
13801
  get shop() {
13835
13802
  return this.fetchAndCache("/api/v4/shop", "shop", "shop");
@@ -15565,10 +15532,7 @@ function Event$2($$anchor, $$props) {
15565
15532
  template_effect(($0, $1) => {
15566
15533
  set_text(text_2, $0);
15567
15534
  set_text(text_3, $1);
15568
- }, [() => formatDate(cartItem().time, {
15569
- month: "numeric",
15570
- day: "numeric"
15571
- }, shop.locale), () => formatTime(cartItem().time)]);
15535
+ }, [() => shop.formatDate(cartItem().time, "dayMonth"), () => shop.formatTime(cartItem().time)]);
15572
15536
  append($$anchor, fragment_1);
15573
15537
  };
15574
15538
  if_block(node, ($$render) => {
@@ -15627,16 +15591,13 @@ function Ticket($$anchor, $$props) {
15627
15591
  var span_3 = root_1$19();
15628
15592
  var text_3 = child(span_3, true);
15629
15593
  reset(span_3);
15630
- template_effect(($0) => set_text(text_3, $0), [() => formatTime(cartItem().time)]);
15594
+ template_effect(($0) => set_text(text_3, $0), [() => shop.formatTime(cartItem().time)]);
15631
15595
  append($$anchor, span_3);
15632
15596
  };
15633
15597
  if_block(node_2, ($$render) => {
15634
15598
  if (cartItem().product.type === "Ticket" && cartItem().product.subtype === "timeslot") $$render(consequent_1);
15635
15599
  });
15636
- template_effect(($0) => set_text(text_2, $0), [() => formatDate(cartItem().time, {
15637
- month: "numeric",
15638
- day: "numeric"
15639
- }, shop.locale)]);
15600
+ template_effect(($0) => set_text(text_2, $0), [() => shop.formatDate(cartItem().time, "dayMonth")]);
15640
15601
  append($$anchor, fragment_1);
15641
15602
  };
15642
15603
  if_block(node_1, ($$render) => {
@@ -15661,12 +15622,8 @@ function Tour$1($$anchor, $$props) {
15661
15622
  if (!cartItem().time) return null;
15662
15623
  try {
15663
15624
  return {
15664
- date: formatDate(cartItem().time, {
15665
- year: "numeric",
15666
- month: "numeric",
15667
- day: "numeric"
15668
- }, shop.locale),
15669
- time: formatTime(cartItem().time)
15625
+ date: shop.formatDate(cartItem().time, "short"),
15626
+ time: shop.formatTime(cartItem().time)
15670
15627
  };
15671
15628
  } catch {
15672
15629
  return {
@@ -18142,12 +18099,14 @@ create_custom_element(SubRow, {
18142
18099
  * the visible row title: event rows compose it from event_title + time because a
18143
18100
  * flat-price event's price row carries no title (the row IS the event) — naming
18144
18101
  * the control from product.title alone left it unnamed (WI #141).
18102
+ *
18103
+ * Locale comes in as a parameter — shared/ components stay store-agnostic (WI #151).
18145
18104
  */
18146
- function quantityLabel(item) {
18105
+ function quantityLabel(item, locale) {
18147
18106
  const { product } = item;
18148
18107
  return isEventTicket(product) ? [
18149
18108
  product.event_title,
18150
- item.time && formatTime(item.time),
18109
+ item.time && formatTime(item.time, locale),
18151
18110
  product.title
18152
18111
  ].filter(Boolean).join(" - ") : product.title;
18153
18112
  }
@@ -18312,7 +18271,7 @@ function Item$1($$anchor, $$props) {
18312
18271
  var alternate_1 = ($$anchor) => {
18313
18272
  {
18314
18273
  let $0 = /* @__PURE__ */ user_derived(() => displayItem().quantity ?? 0);
18315
- let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem()));
18274
+ let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem(), shop.locale));
18316
18275
  QuantityControl($$anchor, {
18317
18276
  get value() {
18318
18277
  return get$2($0);
@@ -36507,10 +36466,7 @@ function Event$1($$anchor, $$props) {
36507
36466
  template_effect(($0, $1) => {
36508
36467
  set_text(text_1, $0);
36509
36468
  set_text(text_2, $1);
36510
- }, [() => formatDate(item().attributes.start_time, {
36511
- month: "numeric",
36512
- day: "numeric"
36513
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36469
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36514
36470
  append($$anchor, fragment);
36515
36471
  };
36516
36472
  if_block(node, ($$render) => {
@@ -36653,20 +36609,14 @@ function TicketSale($$anchor, $$props) {
36653
36609
  template_effect(($0, $1) => {
36654
36610
  set_text(text_3, $0);
36655
36611
  set_text(text_4, $1);
36656
- }, [() => formatDate(item().attributes.start_time, {
36657
- month: "numeric",
36658
- day: "numeric"
36659
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36612
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36660
36613
  append($$anchor, fragment_4);
36661
36614
  };
36662
36615
  var consequent_2 = ($$anchor) => {
36663
36616
  var span_5 = root_3$3();
36664
36617
  var text_5 = child(span_5, true);
36665
36618
  reset(span_5);
36666
- template_effect(($0) => set_text(text_5, $0), [() => formatDate(item().attributes.start_time, {
36667
- month: "numeric",
36668
- day: "numeric"
36669
- }, shop.locale)]);
36619
+ template_effect(($0) => set_text(text_5, $0), [() => shop.formatDate(item().attributes.start_time, "dayMonth")]);
36670
36620
  append($$anchor, span_5);
36671
36621
  };
36672
36622
  if_block(node_5, ($$render) => {
@@ -36858,10 +36808,7 @@ function Tour($$anchor, $$props) {
36858
36808
  template_effect(($0, $1) => {
36859
36809
  set_text(text_2, $0);
36860
36810
  set_text(text_3, $1);
36861
- }, [() => formatDate(item().attributes.start_time, {
36862
- month: "numeric",
36863
- day: "numeric"
36864
- }, shop.locale), () => formatTime(item().attributes.start_time)]);
36811
+ }, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
36865
36812
  append($$anchor, fragment);
36866
36813
  };
36867
36814
  if_block(node, ($$render) => {
@@ -37635,7 +37582,7 @@ function Item($$anchor, $$props) {
37635
37582
  template_effect(($0) => {
37636
37583
  set_text(text, `${item().product.event_title ?? ""} - ${$0 ?? ""}`);
37637
37584
  set_text(text_1, item().product.title);
37638
- }, [() => formatTime(item().time)]);
37585
+ }, [() => shop.formatTime(item().time)]);
37639
37586
  append($$anchor, fragment);
37640
37587
  };
37641
37588
  const default_title = ($$anchor) => {
@@ -37744,7 +37691,7 @@ function Item($$anchor, $$props) {
37744
37691
  var li_6 = sibling(li_5, 2);
37745
37692
  var node_5 = child(li_6);
37746
37693
  {
37747
- let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item()));
37694
+ let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item(), shop.locale));
37748
37695
  QuantityControl(node_5, {
37749
37696
  get value() {
37750
37697
  return item().quantity;
@@ -37922,7 +37869,7 @@ var Details$1 = class {
37922
37869
  this.timeslots = quotaManager.timeslotsOn(date, this.tsd?.timeslotTicketIds).map((x) => ({
37923
37870
  ...x,
37924
37871
  startAt: x.timeSlot,
37925
- timeFormatted: x.timeSlot.substring(11, 16),
37872
+ timeFormatted: shop.formatTime(x.timeSlot),
37926
37873
  available: x.capacity > 0
37927
37874
  }));
37928
37875
  }