cleanup namings

This commit is contained in:
arash16 2022-12-25 22:26:03 +03:30
parent 59b35084c6
commit 97b0c53bc8

View File

@ -4,18 +4,16 @@ function formatDate(date: string | null) {
year: 'numeric', year: 'numeric',
month: 'long', month: 'long',
day: 'numeric', day: 'numeric',
// hour:'2-digit',
// minute: '2-digit',
}).format(new Date(date)); }).format(new Date(date));
} }
if ('Intl' in window) { if ('Intl' in window) {
window.addEventListener('load', () => { window.addEventListener('load', () => {
for(const span of [...document.querySelectorAll('.localizable-date')]) { for(const span of [...document.querySelectorAll('.localizable-date')]) {
var persianDate = formatDate(span.getAttribute('title')); const localizedDate = formatDate(span.getAttribute('title'));
if (persianDate) { if (localizedDate) {
span.innerHTML = persianDate; span.innerHTML = localizedDate;
} }
} }
}); });
} }