docbrown/app/assets/javascripts/initializers/initializeDateTimeHelpers.js
Pavel Tkachenko 9e94b80741
[deploy] Add local_date helper to handle dates with respect of user timezone (#9285)
* 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
2020-07-16 08:45:44 -06:00

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',
});
}