Prvotní nástřel fungující aplikace
This commit is contained in:
17
server/src/utils.ts
Normal file
17
server/src/utils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export function getDate() {
|
||||
const date = new Date();
|
||||
let currentDay = String(date.getDate()).padStart(2, '0');
|
||||
let currentMonth = String(date.getMonth() + 1).padStart(2, "0");
|
||||
let currentYear = date.getFullYear();
|
||||
return `${currentYear}-${currentMonth}-${currentDay}`;
|
||||
}
|
||||
|
||||
/** Vrátí human-readable reprezentaci dnešního data pro zobrazení. */
|
||||
export function getTodayString() {
|
||||
const date = new Date();
|
||||
let currentDay = String(date.getDate()).padStart(2, '0');
|
||||
let currentMonth = String(date.getMonth() + 1).padStart(2, "0");
|
||||
let currentYear = date.getFullYear();
|
||||
let currentDayOfWeek = date.toLocaleDateString("CZ-cs", { weekday: 'long' });
|
||||
return `${currentDay}.${currentMonth}.${currentYear} (${currentDayOfWeek})`;
|
||||
}
|
||||
Reference in New Issue
Block a user