Fix end date reporting and partial year rejection

This commit is contained in:
Jiang Yio 2022-09-24 14:35:10 -04:00
parent 05601e0adb
commit 5035ff2dd1

View File

@ -104,7 +104,8 @@
data() { data() {
return { return {
x_range: this.range, x_range: this.range,
x_date: this.date x_date: this.date,
x_date_end: this.date_end
}; };
}, },
computed: { computed: {
@ -113,8 +114,10 @@
return this.x_date.toLocaleDateString('en-CA'); return this.x_date.toLocaleDateString('en-CA');
}, },
set(value) { set(value) {
value = value.split('-') if(value.length > 0) {
this.x_date = new Date(value[0], value[1] - 1, value[2]); value = value.split('-');
if(value[0] >= 1700) this.x_date = new Date(value[0], value[1] - 1, value[2]);
}
} }
}, },
disp_date_end: { disp_date_end: {
@ -122,8 +125,10 @@
return this.x_date_end.toLocaleDateString('en-CA'); return this.x_date_end.toLocaleDateString('en-CA');
}, },
set(value) { set(value) {
value = value.split('-') if(value.length > 0) {
this.x_date_end = new Date(value[0], value[1] - 1, value[2]); value = value.split('-');
if(value[0] >= 1700) this.x_date_end = new Date(value[0], value[1] - 1, value[2]);
}
} }
}, },
params() { params() {
@ -142,6 +147,8 @@
}, },
date(value) { this.x_date = value; }, date(value) { this.x_date = value; },
x_date(value) { this.$emit('update:date', value); }, x_date(value) { this.$emit('update:date', value); },
date_end(value) { this.x_date_end = value; },
x_date_end(value) { this.$emit('update:date_end', value); },
range(value) { this.x_range = value; }, range(value) { this.x_range = value; },
x_range(value) { this.$emit('update:range', value); } x_range(value) { this.$emit('update:range', value); }
}, },