AM/PM strings

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
turt2live 2017-07-03 09:25:03 -06:00
parent e058dd58e5
commit 45559f7cf0
3 changed files with 5 additions and 1 deletions

View file

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