2 thoughts on “Datepicker: months are 0-base indexed in NgbDate

  1. According to https://en.wikipedia.org/wiki/ISO_8601:

    Calendar date representations are in the form shown in the box to the right. [YYYY] indicates a four-digit year, 0000 through 9999. [MM] indicates a two-digit month of the year, 01 through 12. [DD] indicates a two-digit day of that month, 01 through 31. For example, “5 April 1981” may be represented as either “1981-04-05″[5] in the extended format or “19810405” in the basic format.

    As soon as we introduce formats / masks for dates it would be very awkward to keep using 0-based month numbers.

    My vote would go to using 1-based indexes as we do for years and days. If there are no big objections I’m going to send a PR later in the week (or anyone is free to send one).

  2. Men… This is a great mistake!

    This plugin was made to be used in JavaScript, a 0-digit based. So, this plugin doesn’t work with nothing: JavaScript native Date(), moment(), or any other thing build until today!
    Bad choice.