Přidání restaurace Zastávka u Michala
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { Choices, LocationKey } from "../../types";
|
||||
|
||||
/** Vrátí datum v ISO formátu. */
|
||||
export function formatDate(date: 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}`;
|
||||
export function formatDate(date: Date, format?: string) {
|
||||
let day = String(date.getDate()).padStart(2, '0');
|
||||
let month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
let year = String(date.getFullYear());
|
||||
|
||||
const f = (format === undefined) ? 'YYYY-MM-DD' : format;
|
||||
return f.replace('DD', day).replace('MM', month).replace('YYYY', year);
|
||||
}
|
||||
|
||||
/** Vrátí human-readable reprezentaci předaného data pro zobrazení. */
|
||||
|
||||
Reference in New Issue
Block a user