Zobrazování data u poslední aktualizace menu
This commit is contained in:
@@ -35,4 +35,16 @@ export const getToken = (): string | null => {
|
||||
*/
|
||||
export const deleteToken = () => {
|
||||
localStorage.removeItem(TOKEN_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vrátí human-readable reprezentaci předaného data a času pro zobrazení.
|
||||
*/
|
||||
export function getHumanDateTime(datetime: Date) {
|
||||
let currentDay = String(datetime.getDate()).padStart(2, '0');
|
||||
let currentMonth = String(datetime.getMonth() + 1).padStart(2, "0");
|
||||
let currentYear = datetime.getFullYear();
|
||||
let currentHours = String(datetime.getHours()).padStart(2, '0');
|
||||
let currentMinutes = String(datetime.getMinutes()).padStart(2, "0");
|
||||
return `${currentDay}.${currentMonth}.${currentYear} ${currentHours}:${currentMinutes}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user