@7365admin1/layer-common 4.2.2-staging.268 → 4.2.2-staging.269
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.
|
@@ -108,7 +108,18 @@ function toUTCValue(value: string | null): string | null {
|
|
|
108
108
|
// of watchers: no initial-load flag, no chance of the two models fighting each
|
|
109
109
|
// other, and it behaves the same on the server as in the browser.
|
|
110
110
|
const fieldValue = computed({
|
|
111
|
-
get: () =>
|
|
111
|
+
get: () => {
|
|
112
|
+
// The two models only agree when the setter below wrote them together. When
|
|
113
|
+
// a PARENT writes one of them - the season pass dialog's subscription
|
|
114
|
+
// buttons write the UTC one - the other still holds this component's copy
|
|
115
|
+
// of whatever was in the field before, and reading that copy first would
|
|
116
|
+
// leave the field showing a date the form is no longer holding.
|
|
117
|
+
// Disagreement means the parent wrote, so the parent wins.
|
|
118
|
+
if (dateTimeUTC.value && toUTCValue(dateTime.value) !== dateTimeUTC.value) {
|
|
119
|
+
return toInputValue(dateTimeUTC.value);
|
|
120
|
+
}
|
|
121
|
+
return toInputValue(dateTime.value || dateTimeUTC.value);
|
|
122
|
+
},
|
|
112
123
|
set: (value: string | null) => {
|
|
113
124
|
dateTime.value = value || null;
|
|
114
125
|
dateTimeUTC.value = toUTCValue(value);
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
/>
|
|
269
269
|
<InputDateTimePicker
|
|
270
270
|
ref="startDateRef"
|
|
271
|
-
v-model="vehicle.start"
|
|
271
|
+
v-model:utc="vehicle.start"
|
|
272
272
|
:rules="[validStartDateRule]"
|
|
273
273
|
/>
|
|
274
274
|
</v-col>
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
/>
|
|
282
282
|
<InputDateTimePicker
|
|
283
283
|
ref="expiryDateRef"
|
|
284
|
-
v-model="vehicle.end"
|
|
284
|
+
v-model:utc="vehicle.end"
|
|
285
285
|
:rules="[validExpiryDateRule]"
|
|
286
286
|
/>
|
|
287
287
|
</v-col>
|
|
@@ -439,7 +439,7 @@ const prop = defineProps({
|
|
|
439
439
|
},
|
|
440
440
|
});
|
|
441
441
|
|
|
442
|
-
const { requiredRule,
|
|
442
|
+
const { requiredRule, debounce } = useUtils();
|
|
443
443
|
const {
|
|
444
444
|
addVehicle,
|
|
445
445
|
getCustomSeasonPassTypes,
|
|
@@ -881,15 +881,20 @@ async function submit() {
|
|
|
881
881
|
|
|
882
882
|
// }
|
|
883
883
|
|
|
884
|
+
/*
|
|
885
|
+
* The subscription buttons write the same thing the picker writes: a real
|
|
886
|
+
* instant.
|
|
887
|
+
*
|
|
888
|
+
* `formatDateISO8601` returns `YYYY-MM-DDTHH:mm` with no zone - the browser's
|
|
889
|
+
* WALL CLOCK, not a moment in time. Sent to the API as-is, the server parsed it
|
|
890
|
+
* in its own zone (UTC) and a pass entered as 05/12/2026 6:45 pm came back as
|
|
891
|
+
* 06/12/2026 2:45 am. These two fields now carry UTC end to end, so the preset
|
|
892
|
+
* and the picker cannot disagree about what "now" meant.
|
|
893
|
+
*/
|
|
884
894
|
watch(selectedSubscriptionDuration, (duration) => {
|
|
885
|
-
const dateNowISO =
|
|
886
|
-
const weeksLaterISO = (week: number) =>
|
|
887
|
-
|
|
888
|
-
const dateWeekLater = new Date(
|
|
889
|
-
now.getTime() + week * 7 * 24 * 60 * 60 * 1000
|
|
890
|
-
);
|
|
891
|
-
return formatDateISO8601(dateWeekLater);
|
|
892
|
-
};
|
|
895
|
+
const dateNowISO = new Date().toISOString();
|
|
896
|
+
const weeksLaterISO = (week: number) =>
|
|
897
|
+
new Date(Date.now() + week * 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
893
898
|
|
|
894
899
|
if (duration === "custom") {
|
|
895
900
|
vehicle.start = "";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.2.2-staging.
|
|
5
|
+
"version": "4.2.2-staging.269",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|