Rollen Chunk 6: Team-Tab mit Matrix-Kalender und Genehmigungen
This commit is contained in:
1 parent
8d0f6d8cc7
commit
3cefcefad1
1 file changed
+17
@@ -88,3 +88,20 @@ export function eachDay(start: string, end: string): string[] {
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
const WEEKDAY_SHORT = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
|
||||
|
||||
export function weekdayShort(iso: string): string {
|
||||
const [year, month, day] = iso.split("-").map(Number);
|
||||
return WEEKDAY_SHORT[new Date(Date.UTC(year, month - 1, day)).getUTCDay()];
|
||||
}
|
||||
|
||||
export function shortGermanDate(iso: string): string {
|
||||
const [year, month, day] = iso.split("-").map(Number);
|
||||
return new Date(Date.UTC(year, month - 1, day)).toLocaleDateString("de-DE", {
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
timeZone: "UTC",
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user