* Revise system specs for viewing a comment * Add system specs for viewing comment date * Add conditional to SetTimeZone middleware * Revise comment_date partial * Refactor viewing a comment system specs * Add more system specs for viewing a comment * Fix format of comment date with short year * Fix edited comment date * Fix comment date when posting new comments
25 lines
581 B
JavaScript
25 lines
581 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',
|
|
});
|
|
|
|
// Date with short year: Jul 12 '20
|
|
localizeTimeElements(document.querySelectorAll('time.date-short-year'), {
|
|
year: '2-digit',
|
|
month: 'short',
|
|
day: 'numeric',
|
|
});
|
|
}
|