Open shaylavi opened 3 years ago
Thanks for submitting. But i'm thinking about the following case.
Imagine there is a from
and a to
values set by v-model,
Maybe the defaultPreset could be wrong regarding to those 2 values :
eg: from => tuesday and to => wednesday
will be inconsistent with defaultPreset to week
I'm my opinion you should write something like this :
if (this.to || this.from) {
this.preset = 'custom'
} else {
this.preset = this.defaultPreset
}
Thanks for submitting. But i'm thinking about the following case.
Imagine there is a
from
and ato
values set by v-model, Maybe the defaultPreset could be wrong regarding to those 2 values :eg:
from => tuesday and to => wednesday
will be inconsistent with defaultPreset toweek
I'm my opinion you should write something like this :
if (this.to || this.from) { this.preset = 'custom' } else { this.preset = this.defaultPreset }
Yeah I didn't really go through all edge-cases, it was more about allowing that functionality first and on the dev's responsibility to make sure it works, but sure I'll push that change you suggested. I'm sure there's room for many other improvements.
Allowing user to modify the default preset value