This commit is contained in:
@@ -776,7 +776,6 @@ MID CENTURY MODERN TUNES - https://www.allmusic.com/album/ultra-lounge-vol-14-bo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BUILD 131 CHANGES OF NOTE
|
BUILD 131 CHANGES OF NOTE
|
||||||
|
|
||||||
- case 3946 at a glance wiki present implemented
|
- case 3946 at a glance wiki present implemented
|
||||||
|
|||||||
@@ -79,82 +79,27 @@ export default {
|
|||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
// Turn a utc date into a vueitfy calendar
|
// Turn a utc date into a vueitfy calendar
|
||||||
// schedule control compatible format
|
// schedule control compatible format
|
||||||
// localized:
|
// localized.
|
||||||
//
|
// For ease of use in schedule the epoch (milliseconds) is the best format
|
||||||
// "It must be a Date, number of seconds since Epoch, or a string in the format of YYYY-MM-DD or YYYY-MM-DD hh:mm. Zero-padding is optional and seconds are ignored.""
|
// "It must be a Date, number of seconds since Epoch, or a string in the format of YYYY-MM-DD or YYYY-MM-DD hh:mm. Zero-padding is optional and seconds are ignored.""
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
utcDateToScheduleCompatibleFormatLocalized(
|
utcDateToScheduleCompatibleFormatLocalized(value, timeZoneName) {
|
||||||
value,
|
|
||||||
timeZoneName,
|
|
||||||
languageName,
|
|
||||||
hour12
|
|
||||||
) {
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (!timeZoneName) {
|
|
||||||
timeZoneName = this.getResolvedTimeZoneName();
|
|
||||||
}
|
|
||||||
if (!languageName) {
|
|
||||||
languageName = this.getResolvedLanguage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hour12) {
|
|
||||||
hour12 = this.getHour12();
|
|
||||||
}
|
|
||||||
|
|
||||||
//parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z")
|
|
||||||
let parsedDate = new Date(value);
|
|
||||||
|
|
||||||
//is it a valid date?
|
|
||||||
if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {
|
|
||||||
if (window.$gz.dev) {
|
if (window.$gz.dev) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`locale::utcDateToScheduleCompatibleFormatLocalized - Value '${value}' is not parseable`
|
`locale::utcDateToScheduleCompatibleFormatLocalized - Value is empty`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//return this:
|
return new Date(
|
||||||
//YYYY-MM-DD hh:mm
|
//sv-SE is iso-8601 format so cleanest to parse accurately
|
||||||
|
new Date(value).toLocaleString("sv-SE", {
|
||||||
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts
|
timeZone: timeZoneName
|
||||||
let formatter = new Intl.DateTimeFormat(languageName, {
|
})
|
||||||
year: "numeric",
|
).getTime();
|
||||||
month: "numeric",
|
|
||||||
day: "numeric",
|
|
||||||
hour: "numeric",
|
|
||||||
minute: "numeric",
|
|
||||||
hour12: false,
|
|
||||||
timeZone: timeZoneName
|
|
||||||
});
|
|
||||||
const parts = formatter.formatToParts(parsedDate);
|
|
||||||
|
|
||||||
let p = { year: null, month: null, day: null, hour: null, minute: null };
|
|
||||||
parts.forEach(x => {
|
|
||||||
switch (x.type) {
|
|
||||||
case "year":
|
|
||||||
case "relatedYear":
|
|
||||||
p.year = x.value;
|
|
||||||
break;
|
|
||||||
case "month":
|
|
||||||
p.month = x.value;
|
|
||||||
break;
|
|
||||||
case "day":
|
|
||||||
p.day = x.value;
|
|
||||||
break;
|
|
||||||
case "hour":
|
|
||||||
p.hour = x.value;
|
|
||||||
break;
|
|
||||||
case "minute":
|
|
||||||
p.minute = x.value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return `${p.year}-${p.month}-${p.day} ${p.hour}:${p.minute}`;
|
|
||||||
},
|
},
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
// Turn a utc date into a displayable
|
// Turn a utc date into a displayable
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div v-if="formState.ready" v-resize="onResize" class="my-n8">
|
<div v-if="formState.ready" v-resize="onResize" class="my-n8">
|
||||||
<!-- `{{ "focus:" + focus }}` {{ diagInfo() }}
|
<!-- `{{ "focus:" + focus }}` {{ diagInfo() }}
|
||||||
{{ evInfo }}-->
|
{{ evInfo }}-->
|
||||||
|
{{ events }}
|
||||||
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
|
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
|
||||||
|
|
||||||
<v-sheet height="64">
|
<v-sheet height="64">
|
||||||
@@ -265,6 +266,9 @@ SETTINGS:
|
|||||||
https://vuetifyjs.com/en/components/calendars/#drag-and-drop
|
https://vuetifyjs.com/en/components/calendars/#drag-and-drop
|
||||||
https://vuetifyjs.com/en/components/floating-action-buttons/#speed-dial
|
https://vuetifyjs.com/en/components/floating-action-buttons/#speed-dial
|
||||||
|
|
||||||
|
issues:
|
||||||
|
drag losing end time for event
|
||||||
|
|
||||||
|
|
||||||
Test: overlapping sched items that start or end outside of view
|
Test: overlapping sched items that start or end outside of view
|
||||||
this is a test of the query in schedulecontroller at server
|
this is a test of the query in schedulecontroller at server
|
||||||
@@ -393,12 +397,19 @@ export default {
|
|||||||
//console.log("mouseMove got time:", mouse);
|
//console.log("mouseMove got time:", mouse);
|
||||||
|
|
||||||
if (this.dragEvent && this.dragTime !== null) {
|
if (this.dragEvent && this.dragTime !== null) {
|
||||||
// console.log("mosueMove:A", {
|
console.log("mosueMove:A", {
|
||||||
// dragEvent: this.dragEvent,
|
dragEvent: JSON.stringify(this.dragEvent),
|
||||||
// dragTime: this.dragTime
|
dragTime: JSON.stringify(this.dragTime)
|
||||||
// });
|
});
|
||||||
|
//new Date(this.dragEvent.start).getTime();
|
||||||
const start = this.dragEvent.start;
|
const start = this.dragEvent.start;
|
||||||
const end = this.dragEvent.end;
|
const end = this.dragEvent.end;
|
||||||
|
// if (typeof start == "string") {
|
||||||
|
// start = new Date(start).getTime();
|
||||||
|
// }
|
||||||
|
// if (typeof end == "string") {
|
||||||
|
// end = new Date(end).getTime();
|
||||||
|
// }
|
||||||
const duration = end - start;
|
const duration = end - start;
|
||||||
const newStartTime = mouse - this.dragTime;
|
const newStartTime = mouse - this.dragTime;
|
||||||
|
|
||||||
@@ -409,7 +420,7 @@ export default {
|
|||||||
this.dragEvent.start = newStart;
|
this.dragEvent.start = newStart;
|
||||||
this.dragEvent.end = newEnd;
|
this.dragEvent.end = newEnd;
|
||||||
} else if (this.createEvent && this.createStart !== null) {
|
} else if (this.createEvent && this.createStart !== null) {
|
||||||
//console.log("mosueMove:B");
|
console.log("mosueMove:B");
|
||||||
const mouseRounded = this.roundTime(mouse, false);
|
const mouseRounded = this.roundTime(mouse, false);
|
||||||
//console.log("mouseMove mouseRounded:", mouseRounded);
|
//console.log("mouseMove mouseRounded:", mouseRounded);
|
||||||
const min = Math.min(mouseRounded, this.createStart);
|
const min = Math.min(mouseRounded, this.createStart);
|
||||||
@@ -429,7 +440,7 @@ export default {
|
|||||||
this.extendOriginal = null;
|
this.extendOriginal = null;
|
||||||
},
|
},
|
||||||
cancelDrag() {
|
cancelDrag() {
|
||||||
// console.log("cancelDrag");
|
// console.log("cancelDrag");
|
||||||
if (this.createEvent) {
|
if (this.createEvent) {
|
||||||
if (this.extendOriginal) {
|
if (this.extendOriginal) {
|
||||||
this.createEvent.end = this.extendOriginal;
|
this.createEvent.end = this.extendOriginal;
|
||||||
@@ -615,15 +626,11 @@ export default {
|
|||||||
...x,
|
...x,
|
||||||
start: window.$gz.locale.utcDateToScheduleCompatibleFormatLocalized(
|
start: window.$gz.locale.utcDateToScheduleCompatibleFormatLocalized(
|
||||||
x.start,
|
x.start,
|
||||||
this.timeZoneName,
|
this.timeZoneName
|
||||||
this.languageName,
|
|
||||||
this.hour12
|
|
||||||
),
|
),
|
||||||
end: window.$gz.locale.utcDateToScheduleCompatibleFormatLocalized(
|
end: window.$gz.locale.utcDateToScheduleCompatibleFormatLocalized(
|
||||||
x.end,
|
x.end,
|
||||||
this.timeZoneName,
|
this.timeZoneName
|
||||||
this.languageName,
|
|
||||||
this.hour12
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user