User:Kerri Amber/break.js

1.     /*** BEGIN WIKIBREAK ENFORCER ***/ 2.     addOnloadHook(function {   3.   4.              /*** Start editing here ***/   5.   6.              // When you want to end your break?   7.              // no leading zeroes. (example: 7 - correct, 07 - incorrect)   8.   9.              var date = { year: 2011, month: 2, day: 29};  10.              var time = { hours: 12, minutes: 22, seconds: 0 };  11.  12.              /*** Stop editing here ***/  13.  14.              var currentDate = new Date;  15.              var enforcedBreakEnd = new Date( 16.                     date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);  17.              if (currentDate <= enforcedBreakEnd) {  18.                      alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString 19.                             + "\n(now is "+currentDate.toLocaleString+")\n\nBye!");  20.                      location = "http://"+location.host+"/w/index.php?title="  21.                              + "Special:Userlogout&returnto=Main_Page";  22.              }  23.      }); 24.     /*** END WIKIBREAK ENFORCER ***/