viewDate following the dates (or input) more directly #2490
Closed
jcompagner
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi,
i am wrapping this component in an angular component so i have incoming @input of the date field
But i need todo then this:
this.picker.dates.set(this.mydate);
this.options.viewDate =this.mydate;
so i constantly also need to update the config object, which is in my eyes a bit weird
I get that we can have multiply selection also but even then i kind of expect that the picker when showing (or directly when inline) is at least around the first (or last?) date in the dates list. (so you always see te selection as good as it can)
If i don't set viewDate = xxxx then it always opens in the current month.. which i think most people don't expect.
maybe an option like: this.options.viewFollowDates: true? and then the viewDate will always be set when the dates first is changed?
Or another function where you can set/add the date that right away also sets the viewDate and if possible also doesn't send an change event (because a change event for me is when it is changed through the ui, not when i set it through code, now i kind of need to test that myself, or deregister the listener for a moment)
also: https://github.com/Eonasdan/tempus-dominus/blob/master/src/js/options.ts#L87
viewDate must be according to the api always be a DateTime but this is not really the case right? it can be a Date also
so can this type be DateTime | Date or something like that (and i think this also holds true for others) so that i don't get typescript errors when assigning my date to it (and need to do DateTime.convert() myself)
Johan
Beta Was this translation helpful? Give feedback.
All reactions