PDA

View Full Version : new Date().getLastDayOfMonth() returns 1



nseries
26 Oct 2011, 1:14 AM
Hi,

I'm using ExtJS 3.4 and need to know the last day of the current month.

When i use new Date().getLastDayOfMonth() it returns always 1.

new Date() returns the right Date of Today.

Thanks for Help

nseries

Uberdude
26 Oct 2011, 3:25 AM
That is working correctly and according to the documentation. 1 means the last day of this month of October is a Monday, which is correct.

If you want the answer 31 then new Date().getDaysInMonth() is the right question to ask.