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

Incorrect month number in <div data-month="XXX"> #640

Open
ronan-hello opened this issue Oct 22, 2024 · 4 comments
Open

Incorrect month number in <div data-month="XXX"> #640

ronan-hello opened this issue Oct 22, 2024 · 4 comments

Comments

@ronan-hello
Copy link

The value in data-month is incorrect, value is always 1 value higher. Maybe an Array index error starting at 0 ?

@t1m0n
Copy link
Owner

t1m0n commented Oct 31, 2024

Actually it's designed to be like that, it is used in inner logic. Since the Date.getMonth() method returns the month number starting from zero, it is convenient to use such values in DOM attributes.

Maybe adding full date string will be more suitable for your case? e.g. - year-month-date

@ronan-hello
Copy link
Author

Hi,

It may be more useful as a standard YYYY-MM-DD date format as you can manipulate it and change format as you want, right ? (ISO 8601)
Maybe add a new data-date attribute ? or update the existing one ?

@t1m0n
Copy link
Owner

t1m0n commented Nov 5, 2024

Yeah, that's what I was talking about )
I will add a new attribute with yyyy-mm-dd.

@ronan-hello
Copy link
Author

OK, thank you so much !

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

No branches or pull requests

2 participants