mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
commit
db3d455a1d
@ -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}`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user