feat: ajout de la timezone pour les exports
This commit is contained in:
+9
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user