md2 icon indicating copy to clipboard operation
md2 copied to clipboard

Error when selecting a month with 30 days or less when datepicker is of type 'month'.

Open PetrisorIustin opened this issue 8 years ago • 2 comments

Bug:

I have an date picker input of type 'month'. When I open the dialog and I pick a month with 30 days or less it gives me an error on console 'ERROR TypeError: Cannot read property 'getFullYear' of null' If I select a month with 31 days it works as expected and after that even the months with 30 days or less can be selected.

I also checked on http://code.promactinfo.com/md2/#/datepicker for type 'month' and the bug is also reproducing in your demo.

PetrisorIustin avatar Jul 31 '17 13:07 PetrisorIustin

This problem may be related to #276 . It can be reproduced at v0.0.28.

DE-Kato avatar Sep 19 '17 09:09 DE-Kato

Fiexed with ->

(DateUtil.prototype as any).createDate = (year, month, date, hours, minutes, seconds) => { let ret = new Date(year, month, date, hours, minutes, seconds); return ret.getMonth() == month ? ret : new Date(year, month + 1, 0, hours, minutes, seconds); }

Mfron-42 avatar Feb 01 '18 04:02 Mfron-42