Content deleted Content added
DreamRimmer (talk | contribs) make it simple, fix pattern |
DreamRimmer (talk | contribs) fix |
||
Line 556:
const rfcs = [];
const rfcEntryPattern = /'''\[\[([^\]|]+)(?:\|([^\]]+))?\]\]'''[\s\S]*?\{\{rfcquote\|text=([\s\S]*?)\}\}[\s\S]*?(\d{2}:\d{2}, \d{1,2} \w+ \d{4} \(UTC\))/g;
const now = new Date();
const currentUtcYear = now.getUTCFullYear();
const currentUtcMonth = now.getUTCMonth();
const currentUtcDate = now.getUTCDate();
const currentUtcHours = now.getUTCHours();
const currentUtcMinutes = now.getUTCMinutes();
const currentUtc = new Date(Date.UTC(currentUtcYear, currentUtcMonth, currentUtcDate, currentUtcHours, currentUtcMinutes, 0, 0));
let match;
Line 572 ⟶ 579:
let daysDiff = null;
if (timestampStr) {
const
if (
const
"January","February","March","April","May","June","July","August","September","October","November","December"
];
const monthNum = months.indexOf(monthText);
if (monthNum !== -1) {
const tsDate = new Date(Date.UTC(
parseInt(year,10),
monthNum,
parseInt(day,10),
parseInt(hour,10),
parseInt(minute,10),
0, 0
));
daysDiff = Math.floor((currentUtc - tsDate) / (1000 * 60 * 60 * 24));
}
}
}
|