Skip to content
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

Datapicker is adding '01' after date, when view is setup as months. #175

Open
dobrzyc opened this issue Jan 2, 2024 · 1 comment
Open

Comments

@dobrzyc
Copy link

dobrzyc commented Jan 2, 2024

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.

@mymth
Copy link
Owner

mymth commented Jan 3, 2024

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.

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

No branches or pull requests

2 participants