1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

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}`;
}