From d5d01112be410d90df47d0203ecef33cbd4472fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr> Date: Tue, 26 Mar 2024 17:09:15 +0100 Subject: [PATCH] Plus de formatDate --- js/Client/unicaenVue.js | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/js/Client/unicaenVue.js b/js/Client/unicaenVue.js index b143883..ed6ad50 100644 --- a/js/Client/unicaenVue.js +++ b/js/Client/unicaenVue.js @@ -47,37 +47,6 @@ const unicaenVue = { } return params.join('&'); - }, - /** - * Formate une date pour affichage - * - * @param String val - * @param String format - * @returns String - */ - formatDate: (val, format) => { - - if (val === undefined) { - return undefined; - } - let date = new Date(val); - - const year = date.getFullYear(); - const month = (date.getMonth() + 1).toString().padStart(2, '0'); - const day = date.getDate().toString().padStart(2, '0'); - const hour = date.getHours().toString().padStart(2, '0'); - const min = date.getMinutes().toString().padStart(2, '0'); - const sec = date.getSeconds().toString().padStart(2, '0'); - if(format) { - switch(format){ - case 'datetime': - return `${day}/${month}/${year} à ${hour}:${min}`; - case 'time': - return `${hour}:${min}:${sec}`; - } - } - - return `${day}/${month}/${year}`; } }; -- GitLab