User:Mxn/CommentsInLocalTime/sandbox.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 220:
}
if (monthIndex !== -1) {
then var offsetHours = components.utcOffset(hours - LocalComments.utcOffset);
then = new Date(Date.UTC(components.year, monthIndex, components.day, components.hours, components.minutes));
var minuteOffset = (LocalComments.utcOffset - Math.round(LocalComments.utcOffset)) % 60;
var offsetMinutes = components.minutes - minuteOffset;
then = new Date(Date.UTC(components.year, monthIndex, components.day, components.hoursoffsetHours, components.minutesoffsetMinutes));
}
}
Line 232 ⟶ 235:
var timeElt = $("<time />");
if (!isNaN(then)) {
then.utcOffset(-LocalComments.utcOffset);
// MediaWiki core styles .explain[title] the same way as
// abbr[title], guiding the user to the tooltip.
Line 386 ⟶ 388:
}
wrapTimestamps();
mw.loader.using("moment", function () {
formatTimestamps();
wrapTimestamps();
formatTimestamps();
});
LocalComments.wrapTimestamps = wrapTimestamps;