Skip to content

Commit

Permalink
TimeFormat: Don't format <time> elements outside of posts (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Dec 7, 2023
1 parent a07e59e commit 70a428c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scripts/timeformat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import moment from '../lib/moment.js';
import { keyToCss } from '../util/css_map.js';
import { pageModifications } from '../util/mutations.js';
import { getPreferences } from '../util/preferences.js';

Expand Down Expand Up @@ -41,7 +42,7 @@ const formatTimeElements = function (timeElements) {

export const main = async function () {
({ format, displayRelative } = await getPreferences('timeformat'));
pageModifications.register('time[datetime]', formatTimeElements);
pageModifications.register(`${keyToCss('timestamp')}[datetime]`, formatTimeElements);
};

export const clean = async function () {
Expand Down

0 comments on commit 70a428c

Please sign in to comment.