1 parent
eaad6f1e77
commit
a5da756803
51 files changed
+537
-672
No files matched your search
+4
-2
@@ -12,12 +12,14 @@ export function uid(): string {
|
||||
return Date.now().toString(36) + Math.random().toString(36).slice(2, 10)
|
||||
}
|
||||
|
||||
export function todayISO(): string {
|
||||
const d = new Date()
|
||||
/** Jour local AAAA-MM-JJ (et pas le jour UTC : un épisode diffusé à 1 h du matin reste au bon jour). */
|
||||
export function localDay(d: Date = new Date()): string {
|
||||
const pad = (n: number) => String(n).padStart(2, '0')
|
||||
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
|
||||
}
|
||||
|
||||
export const todayISO = () => localDay()
|
||||
|
||||
export function cx(...classes: (string | false | null | undefined)[]): string {
|
||||
return classes.filter(Boolean).join(' ')
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user