Would you accept a PR which adds getViewDate and setViewDate methods to public api? Implementation should follow defaultViewDate even so at least I didn't expected such a syntax.
So in detail I like to add this public api methods:
$().datepicker('getViewDate'); returns current viewDate as a plain object having keys year, month, day.
$().datepicker('setViewDate', { year: 2000, month: 0, day: 1 }); updates datepicker with view date ''1 January 2000''. If keys are missing they should default to the same as defaultViewDate. So $().datepicker('setViewDate', {}); would update datepicker with today as view date.
It's already possible to manipulate viewDate by using private api method _setDate with a Date object as first and 'view' as second parameter. So implementation is easily possible.
This new public api methods would allow implementing linked datepickers without using private api. Linked datepickers could be used to implement "showing multiple month" feature which is heavily requested (#1154 and many duplicates). I've written a proof of concept to show it's actually working: https://jsfiddle.net/v6q2rxs0/
getViewDate isn't really necessary therefore but should be added for consistency.
Would love to get some feedback before starting implementation.
Any updates on this?
This would be a really useful feature.
Most helpful comment
Any updates on this?
This would be a really useful feature.