diff --git a/htdocs/DateRangePicker.vue b/htdocs/DateRangePicker.vue index 6531f58..e851fd4 100644 --- a/htdocs/DateRangePicker.vue +++ b/htdocs/DateRangePicker.vue @@ -104,7 +104,8 @@ data() { return { x_range: this.range, - x_date: this.date + x_date: this.date, + x_date_end: this.date_end }; }, computed: { @@ -113,8 +114,10 @@ return this.x_date.toLocaleDateString('en-CA'); }, set(value) { - value = value.split('-') - this.x_date = new Date(value[0], value[1] - 1, value[2]); + if(value.length > 0) { + value = value.split('-'); + if(value[0] >= 1700) this.x_date = new Date(value[0], value[1] - 1, value[2]); + } } }, disp_date_end: { @@ -122,8 +125,10 @@ return this.x_date_end.toLocaleDateString('en-CA'); }, set(value) { - value = value.split('-') - this.x_date_end = new Date(value[0], value[1] - 1, value[2]); + if(value.length > 0) { + value = value.split('-'); + if(value[0] >= 1700) this.x_date_end = new Date(value[0], value[1] - 1, value[2]); + } } }, params() { @@ -142,6 +147,8 @@ }, date(value) { this.x_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; }, x_range(value) { this.$emit('update:range', value); } },