AM/PM strings
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
e058dd58e5
commit
45559f7cf0
3 changed files with 5 additions and 1 deletions
|
@ -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}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue