Calendar dayClick bug

Hello,
Calendar is
When using calendar.getValue or dayClick, month value is 1 month behind. for example:
If I select August 11 2022, value returned is July 11 2022

Any advise,
Kris

If I check the kitchen sink demo and see the html source, data-month parameter is not correct


Months count in JS starts from 0 (January), so all looks correct to me

Please check the jsfiddle, if you click on the date - calendar opens, select a date - you should see alert with date with dayClick Event, - date shown is in correct -

https://jsfiddle.net/osgLqx7n/3/

May be I am missing something,

Kris

From what i see everything is correct:

Don’t know if I am doing something wrong or not -
When I open the fiddle and click on the date, calendar shows - august 2022, I click on 18 and dayClick event is called and date out is 7/18/2022 - which is July

Console log event at first is undefined since there is no value set, after the click event getValue() shows correctly

Issue is dayClick date is not showing correctly.

Thanks for looking into it.

Month 7 is august

Thank you for looking into it and providing explanations - I am perplexed as to how to get the correct date clicked with dayClick event.

Since it starts with 0. You can do something like this.

app.dialog.alert('Day click date is '+ (month + 1) +'/'+day+'/'+year);

If you want to fetch the date once the calendar is closed then you can use dateFormat and then fetch it in calendar:close event.

1 Like