@jtakeit/kit 0.5.1 → 0.5.2
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/elements/booking.js +8 -2
- package/package.json +1 -1
package/elements/booking.js
CHANGED
|
@@ -636,6 +636,12 @@ export function wireBooking(form) {
|
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
638
|
hint.textContent = '';
|
|
639
|
+
// A price beside each time only where the times differ in price — a
|
|
640
|
+
// rate by the hour (wiki/68). Where every time costs the same, the
|
|
641
|
+
// price is the services' and is said beside them: «09:00 · CHF 95» on
|
|
642
|
+
// thirty pills is one number read thirty times (11 October 2026).
|
|
643
|
+
const slotPrices = new Set(data.slots.map((one) => one.costs_minor ?? 0));
|
|
644
|
+
const pricedByTime = slotPrices.size > 1;
|
|
639
645
|
for (const slot of data.slots) {
|
|
640
646
|
const button = document.createElement('button');
|
|
641
647
|
button.type = 'button';
|
|
@@ -646,8 +652,8 @@ export function wireBooking(form) {
|
|
|
646
652
|
? slot.ends ? `${dayAndHour(slot.start, false)} — ${dayAndHour(slot.ends, false)}` : dayAndHour(slot.start, false)
|
|
647
653
|
: clock(slot.start);
|
|
648
654
|
// What the booking starting here costs — the platform's number, every
|
|
649
|
-
// hour by its own row (wiki/68) — beside the time,
|
|
650
|
-
if (slot.costs_minor > 0) button.textContent += ` · ${money(slot.costs_minor, currency, pageLang())}`;
|
|
655
|
+
// hour by its own row (wiki/68) — beside the time, where it varies.
|
|
656
|
+
if (pricedByTime && slot.costs_minor > 0) button.textContent += ` · ${money(slot.costs_minor, currency, pageLang())}`;
|
|
651
657
|
button.dataset.start = slot.start;
|
|
652
658
|
button.addEventListener('click', () => {
|
|
653
659
|
chosen = slot.start;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jtakeit/kit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "The framework-free half of a site on jtakeit: the booking form as an element and as markup, for Astro through @jtakeit/astro and for any other generator directly",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|