From 97b0c53bc8f4677177e9c46793270cb5f525cf6d Mon Sep 17 00:00:00 2001 From: arash16 Date: Sun, 25 Dec 2022 22:26:03 +0330 Subject: [PATCH] cleanup namings --- assets/js/datelocale.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/js/datelocale.ts b/assets/js/datelocale.ts index e0adfd35..f26a0fea 100644 --- a/assets/js/datelocale.ts +++ b/assets/js/datelocale.ts @@ -4,18 +4,16 @@ function formatDate(date: string | null) { year: 'numeric', month: 'long', day: 'numeric', - // hour:'2-digit', - // minute: '2-digit', }).format(new Date(date)); } if ('Intl' in window) { window.addEventListener('load', () => { for(const span of [...document.querySelectorAll('.localizable-date')]) { - var persianDate = formatDate(span.getAttribute('title')); - if (persianDate) { - span.innerHTML = persianDate; + const localizedDate = formatDate(span.getAttribute('title')); + if (localizedDate) { + span.innerHTML = localizedDate; } } }); -} \ No newline at end of file +}