Skip to content

Commit fed5ca3

Browse files
committed
learn.microsoft.com changed from using the data-article-date element to the local-time tag.
1 parent 7e2cd6b commit fed5ca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const timeAgoLabels = {
3636

3737
const debug = new URLSearchParams(window.location.search).get("jp-learn-microsoft-com-update-checker-debug");
3838

39-
// Get data-article-date element in current page
40-
const dataArticleDateElement = document.querySelector('time[data-article-date]');
39+
// Get local-time tag in current page
40+
const dataArticleDateElement = document.querySelector('local-time');
4141
if (!dataArticleDateElement) return;
4242

4343
// Parse article date
@@ -56,7 +56,7 @@ const timeAgoLabels = {
5656
const parser = new DOMParser();
5757
const doc = parser.parseFromString(data, "text/html");
5858

59-
const englishDateStr = doc.querySelector('time[data-article-date]')?.getAttribute("datetime");
59+
const englishDateStr = doc.querySelector('local-time')?.getAttribute("datetime");
6060
if (!englishDateStr) return;
6161
const englishDate = new Date(englishDateStr);
6262

0 commit comments

Comments
 (0)