Cannabis Ruderalis

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// Based on the script at [[Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer]]
// Built for taking a wikibreak, but only starting later
// Set when it will start, and how long it will last for
/*** BEGIN WIKIBREAK PLANNER ***/
$(document).ready(function() {
	/*** Start editing here ***/
	// no leading zeroes. (example: 9 - correct, 09 - incorrect)
	// start date and time
	var date1 = { year: 2018, month: 11, day: 30};
	var time1 = { hours: 14, minutes: 08, seconds: 0 };

	// end date and time
	var date2 = { year: 2018, month: 11, day: 30};
	var time2 = { hours: 14, minutes: 12, seconds: 0 };
	/*** Stop editing here ***/
	
	var currentDate = new Date();
	var breakStart = new Date(
		date1.year,date1.month-1,date1.day,time1.hours,time1.minutes,time1.seconds);
	var enforcedBreakEnd = new Date(
		date2.year,date2.month-1,date2.day,time2.hours,time2.minutes,time2.seconds);
	if ((currentDate >= breakStart) && (currentDate <= enforcedBreakEnd)) {
		alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
			+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
		
		/*** The line below sets the page to which you will be sent.
		 * Leaving it completely commented out means you will not be directed anywhere.
		 * Leaving it as the default directs you to the logout page, and automatically logs you out.
		 * Default: location = "//"+location.host+"/w/index.php?title="
			+ "Special:Userlogout&returnto=Main_Page";
		 ***/
		location = "//"+location.host+"/w/index.php?title="
			+ "Special:Userlogout&returnto=Main_Page";
	}
});
/*** END WIKIBREAK PLANNER ***/

Leave a Reply