feat: ajout de la timezone pour les exports

This commit is contained in:
2026-01-24 00:40:38 +04:00
parent 760ca0609d
commit d19fbf990b
3 changed files with 13 additions and 6 deletions
+9 -2
View File
@@ -19,10 +19,17 @@ export function formatKonstitisyon(titres, articles) {
return konstitisyon
}
export function formatDate(date, formatStr = 'PP') {
return format(date, formatStr, {
export function formatDate(date, formatStr = 'PP', {withTimezone = false} = {}) {
const formatted = format(date, formatStr, {
locale: fr
})
if (withTimezone) {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
return `${formatted} (${timezone})`
}
return formatted
}
export function hasRestrictedChar(text) {