Join GitHub today
Add k and kk formatting tokens #3102
This fixes issue #2762.
The consensus from that issue seemed to be that the presence of the
It should be noted that this decision introduces a bit of an inconsistency, given that the parsing behavior introduced here does change the day when an hour of 24 is present.
In other words,
moment('2016-04-09T24:00:00') // yields a moment representing midnight at the start of April 10th, introduced in #1965 moment('2016-04-09T24:00:00').format('YYYY-MM-DD[T]kk:mm:ss') // "2016-04-10T24:00:00" (different from the original format string that was parsed)
I'm not extremely familiar with the internal codebase, so please let me know if there's anything that I did incorrectly or that I should add.