User:PorkchopGMX/wikibreakenforcersimple.js

// Simplified version of WP:BREAKENF. To use this script, paste this into your common.js file (at [{Special:MyPage/common.js]]): // // importScript("User:PorkchopGMX/wikibreakenforcersimple.js"); // wikiBreakEnforcer(2017, 3, 27, 0, 0, 0); // // The first three digits in the function are equal to: // var date = { year: 2017, month: 3, day: 27}; // While the last three digits are equal to: // var time = { hours: 0, minutes: 0, seconds: 0 }; // Make sure not to add any leading zeros.

function wikiBreakEnforcer(yr, mth, dy, h, m, s) { /*** BEGIN WIKIBREAK ENFORCER ***/ var date = { year: yr, month: mth, day: dy}; var time = { hours: h, minutes: m, seconds: s }; var currentDate = new Date; var enforcedBreakEnd = new Date( date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds); if (currentDate <= enforcedBreakEnd) { alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString  + "\n(now is "+currentDate.toLocaleString+")\n\nBye!"); } /*** END WIKIBREAK ENFORCER ***/ }