docbrown/app/javascript/packs/initializers/initializeCommentDate.js
Lawrence 3186f7ae2d
CommentDate Migration to Pack tag (#19025)
* migration init

* create an initializers directory

* remove console log

* migrate localDateTime functions and remove comment date from asset pipeline

* add unit test

* add one more

* year test
2023-02-03 13:40:17 -06:00

9 lines
301 B
JavaScript

import { addLocalizedDateTimeToElementsTitles } from "../../utilities/localDateTime";
export function initializeCommentDate() {
const commentsDates = document.querySelectorAll('.comment-date time');
if (commentsDates) {
addLocalizedDateTimeToElementsTitles(commentsDates, 'datetime');
}
}