katafractari / ngx-combo-datepicker

Angular 4+ Combo Datepicker
https://katafractari.gitbooks.io/ngx-combo-datepicker/
MIT License
7 stars 8 forks source link

Fix leap year calculation and integer parsing #1

Closed freezy closed 6 years ago

freezy commented 6 years ago

This PR fixes two rather annoying bugs:

  1. NaN is short for "not a number", so you need to validate against !isNan() to check if it's a number.
  2. The leap year rules is: Every forth year, but only if not dividable by 100 but not 400. For example, the year 2000 was a leap year because it's dividable by 400. Your current code returns 28 days for the year 2000.

It would be great having those changes on NPM. Cheers!

katafractari commented 6 years ago

@freezy Merged and published to NPM. Thanks for your contribution!

freezy commented 6 years ago

Cheers!