Open dobrzyc opened 9 months ago
My setup is: datepicker = new Datepicker(elem, { buttonClass: 'btn', format: 'yyyymm', todayButton: true, todayHighlight: true, startView: 1, pickLevel: 1, clearButton: true, autohide: true, datesDisabled: true, });
When I chose date, date picker is adding '01' to choose value. For example: I've chose 202205, and input box i showing 20220501.
The same behaviour is on the live demo.
Please read the first one in the notes in here: https://mymth.github.io/vanillajs-datepicker/#/date-string+format?id=date-format
You need to create a custom parser/formatter to handle separator-less date string.
My setup is: datepicker = new Datepicker(elem, { buttonClass: 'btn', format: 'yyyymm',
todayButton: true, todayHighlight: true, startView: 1, pickLevel: 1, clearButton: true, autohide: true, datesDisabled: true, });
When I chose date, date picker is adding '01' to choose value. For example: I've chose 202205, and input box i showing 20220501.
The same behaviour is on the live demo.