Skip to content

added a preset default prop to allow #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shaylavi
Copy link

Allowing user to modify the default preset value

modifying default preset value
@damienroche
Copy link
Owner

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
}

@shaylavi
Copy link
Author

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
}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants