Styling and date changes on punishment page
Some styling changes for the punishments page. Also changes how the dates are displayed - they should display differently depending on what region you're in.
This commit is contained in:
@@ -53,7 +53,14 @@ export class HistoryComponent implements OnInit, OnChanges {
|
||||
|
||||
public getPunishmentTime(entry: PunishmentHistoryInner) {
|
||||
const date = new Date(entry.punishmentTime);
|
||||
return date.toLocaleDateString(navigator.language);
|
||||
return date.toLocaleString(navigator.language, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
}
|
||||
|
||||
public getExpiredTime(entry: PunishmentHistoryInner) {
|
||||
@@ -61,6 +68,13 @@ export class HistoryComponent implements OnInit, OnChanges {
|
||||
return "Permanent " + entry.type.charAt(0).toUpperCase() + entry.type.slice(1);
|
||||
}
|
||||
const date = new Date(entry.punishmentTime + entry.expiryTime);
|
||||
return date.toLocaleDateString(navigator.language);
|
||||
return date.toLocaleString(navigator.language, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user