3 ms·
Good catch. Easy fix: // Preserve 2400h time by changing leading zeros to 24. time = time.replace( /^0*[0:]/, '24' );
by thangalin 2y ago
Good catch. Easy fix:
// Preserve 2400h time by changing leading zeros to 24.
time = time.replace( /^0*[0:]/, '24' );
- thaumasiotes 2y ago> Easy fix: That converts "0800" into "00:00AM".
- thangalin 2y agoTrue enough, the regex was overzealous. This looks better: time = time.replace( /^0*(0:)+/, '24' );