Merge pull request #939 from turt2live/patch-1

Fix PM being AM
This commit is contained in:
Michael Telatynski 2017-05-26 21:05:46 +01:00 committed by GitHub
commit db3d455a1d

View file

@ -54,7 +54,7 @@ function pad(n) {
function twelveHourTime(date) { function twelveHourTime(date) {
let hours = date.getHours() % 12; let hours = date.getHours() % 12;
const minutes = pad(date.getMinutes()); const minutes = pad(date.getMinutes());
const ampm = hours >= 12 ? 'PM' : 'AM'; const ampm = date.getHours() >= 12 ? 'PM' : 'AM';
hours = pad(hours ? hours : 12); hours = pad(hours ? hours : 12);
return `${hours}:${minutes} ${ampm}`; return `${hours}:${minutes} ${ampm}`;
} }