Changed the way that we define end dates.
This commit is contained in:
@@ -35,7 +35,8 @@ Vue.createApp({
|
||||
if (now.isSameOrAfter(next7pm)) {
|
||||
next7pm.add(1, 'day');
|
||||
}
|
||||
const twoHoursLater = moment(next7pm).add(2, 'hours');
|
||||
event.hours = 2.5;
|
||||
const twoHoursLater = moment(next7pm).add(event.hours, 'hours');
|
||||
event.start = next7pm.format('YYYY-MM-DDTHH:mm');
|
||||
event.end = twoHoursLater.format('YYYY-MM-DDTHH:mm');
|
||||
this.events.unshift(event);
|
||||
@@ -63,6 +64,9 @@ Vue.createApp({
|
||||
validateEvents: function() {
|
||||
var faults = [];
|
||||
for ( var e in this.events ) {
|
||||
var start = moment(this.events[e].start);
|
||||
var end = start.add(this.events[e].hours, 'hours');
|
||||
this.events[e].end = end.format('YYYY-MM-DDTHH:mm');
|
||||
for ( var k in this.fields ) {
|
||||
var value = this.events[e][k];
|
||||
value = ( value == undefined ? '' : value );
|
||||
@@ -117,7 +121,7 @@ Vue.createApp({
|
||||
this.validateEvents();
|
||||
},
|
||||
modalCancel: function() {
|
||||
frm.modal = null;
|
||||
this.frm.modal = null;
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
Reference in New Issue
Block a user