* Add local_date helper to handle dates with respect of user timezone * Fix date timezone bug for articles/show * Fix date_helper to meet system specs requirements
18 lines
399 B
JavaScript
18 lines
399 B
JavaScript
/* global localizeTimeElements */
|
|
|
|
'use strict';
|
|
|
|
function initializeDateHelpers() {
|
|
// Date without year: Jul 12
|
|
localizeTimeElements(document.querySelectorAll('time.date-no-year'), {
|
|
month: 'short',
|
|
day: 'numeric',
|
|
});
|
|
|
|
// Full date: Jul 12, 2020
|
|
localizeTimeElements(document.querySelectorAll('time.date'), {
|
|
year: 'numeric',
|
|
month: 'short',
|
|
day: 'numeric',
|
|
});
|
|
}
|