Fix timestamp display

polling-api
Noah 2023-10-22 16:07:58 -07:00
parent fea1d1c7b9
commit 95c6c7859f
2 changed files with 1 additions and 12 deletions

View File

@ -2717,17 +2717,6 @@ export default {
});
},
// Format a datetime nicely for chat timestamp.
prettyDate(date) {
if (date == undefined) return '';
let hours = date.getHours(),
minutes = String(date.getMinutes()).padStart(2, '0'),
ampm = hours >= 11 ? "pm" : "am";
let hour = hours % 12 || 12;
return `${(hour)}:${minutes} ${ampm}`;
},
// CSS classes for the profile button (color coded genders)
profileButtonClass(user) {
// VIP background.

View File

@ -156,7 +156,7 @@ export default {
if (date == undefined) return '';
let hours = date.getHours(),
minutes = String(date.getMinutes()).padStart(2, '0'),
ampm = hours >= 11 ? "pm" : "am";
ampm = hours >= 12 ? "pm" : "am";
let hour = hours % 12 || 12;
return `${(hour)}:${minutes} ${ampm}`;