This commit is contained in:
2021-09-19 23:09:41 +00:00
parent a7a6293015
commit 455cef805f
2 changed files with 33 additions and 16 deletions

View File

@@ -208,13 +208,20 @@ export default {
)}`; )}`;
setDirty = true; setDirty = true;
} else { } else {
//---------------------------------------------------------- //Here from schedule with pre-filled dates?
//NEW OBJECT DEFAULTS if (this.$route.params.add) {
let defaultDates = window.$gz.locale.defaultStartDateTime( const n = this.$route.params.add;
window.$gz.type.Reminder vm.obj.startDate = n.start;
); vm.obj.stopDate = n.end;
vm.obj.startDate = defaultDates.start; } else {
vm.obj.stopDate = defaultDates.end; //----------------------------------------------------------
//NEW OBJECT DEFAULTS
let defaultDates = window.$gz.locale.defaultStartDateTime(
window.$gz.type.Reminder
);
vm.obj.startDate = defaultDates.start;
vm.obj.stopDate = defaultDates.end;
}
//---------------------------------------------------------- //----------------------------------------------------------
} }
} }

View File

@@ -396,6 +396,14 @@ export default {
newItem(atype) { newItem(atype) {
let newEvent = this.events[this.events.length - 1]; let newEvent = this.events[this.events.length - 1];
console.log("new item", { type: atype, event: newEvent }); console.log("new item", { type: atype, event: newEvent });
const addStart = window.$gz.locale.localScheduleFormatToUTC8601String(
newEvent.start,
this.timeZoneName
);
const addEnd = window.$gz.locale.localScheduleFormatToUTC8601String(
newEvent.end,
this.timeZoneName
);
switch (atype) { switch (atype) {
case this.$ay.ayt().WorkOrderItemScheduledUser: case this.$ay.ayt().WorkOrderItemScheduledUser:
this.$router.push({ this.$router.push({
@@ -404,14 +412,8 @@ export default {
recordid: 0, recordid: 0,
add: { add: {
type: atype, type: atype,
start: window.$gz.locale.localScheduleFormatToUTC8601String( start: addStart,
newEvent.start, end: addEnd,
this.timeZoneName
),
end: window.$gz.locale.localScheduleFormatToUTC8601String(
newEvent.end,
this.timeZoneName
),
userId: this.$store.state.userId, userId: this.$store.state.userId,
name: this.$store.state.userName name: this.$store.state.userName
} }
@@ -421,7 +423,15 @@ export default {
case this.$ay.ayt().Reminder: case this.$ay.ayt().Reminder:
this.$router.push({ this.$router.push({
name: "reminder-edit", name: "reminder-edit",
params: { recordid: 0 } params: {
recordid: 0,
add: {
start: addStart,
end: addEnd,
userId: this.$store.state.userId,
name: this.$store.state.userName
}
}
}); });
break; break;
} }