Ajout des notification + page employé (#6)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #6 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #6.
This commit is contained in:
@@ -6,6 +6,17 @@ export const toYmd = (year: number, month: number, day: number) => {
|
||||
|
||||
export const normalizeDate = (value: string) => value.slice(0, 10)
|
||||
|
||||
export const formatYmdToFr = (value: string) => {
|
||||
const [year, month, day] = value.split('-')
|
||||
if (!year || !month || !day) return value
|
||||
return `${day}/${month}/${year}`
|
||||
}
|
||||
|
||||
export const formatNullableYmdToFr = (value?: string | null, fallback = 'En cours') => {
|
||||
if (!value) return fallback
|
||||
return formatYmdToFr(value)
|
||||
}
|
||||
|
||||
export const parseYmd = (value: string) => {
|
||||
const [year, month, day] = value.split('-').map(Number)
|
||||
if (!year || !month || !day) return null
|
||||
|
||||
Reference in New Issue
Block a user