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;
} else {
//----------------------------------------------------------
//NEW OBJECT DEFAULTS
let defaultDates = window.$gz.locale.defaultStartDateTime(
window.$gz.type.Reminder
);
vm.obj.startDate = defaultDates.start;
vm.obj.stopDate = defaultDates.end;
//Here from schedule with pre-filled dates?
if (this.$route.params.add) {
const n = this.$route.params.add;
vm.obj.startDate = n.start;
vm.obj.stopDate = n.end;
} else {
//----------------------------------------------------------
//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) {
let newEvent = this.events[this.events.length - 1];
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) {
case this.$ay.ayt().WorkOrderItemScheduledUser:
this.$router.push({
@@ -404,14 +412,8 @@ export default {
recordid: 0,
add: {
type: atype,
start: window.$gz.locale.localScheduleFormatToUTC8601String(
newEvent.start,
this.timeZoneName
),
end: window.$gz.locale.localScheduleFormatToUTC8601String(
newEvent.end,
this.timeZoneName
),
start: addStart,
end: addEnd,
userId: this.$store.state.userId,
name: this.$store.state.userName
}
@@ -421,7 +423,15 @@ export default {
case this.$ay.ayt().Reminder:
this.$router.push({
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;
}