Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function moment() { return Date().split(' '); }
- var firstMoment = moment();
- document.getElementById('zeroDay').innerHTML = (Number(firstMoment[2]) + 1).toString();
- document.getElementById('endDay').innerHTML = (Number(firstMoment[2]) + 2).toString();
- function checkFirstTime() {
- if ( Number(firstMoment[4].split(':')[0]) >= 1 ) {
- document.getElementById('zeroDay').innerHTML = (Number(firstMoment[2]) + 2).toString();
- }
- return checkSecondTime();
- }
- function checkSecondTime() {
- if ( (firstMoment[4].split(':')[0] === "01") && (Number(firstMoment[4].split(':')[1]) >= 0) ) {
- document.getElementById('endDay').innerHTML = (Number(firstMoment[2]) + 3).toString();
- }
- //console.log("done");
- }
- function isFriday() {
- if (firstMoment[0] === "Fri")
- document.getElementById('zeroDay').innerHTML = (zeroDay + 3).toString();
- else if (firstMoment[0] === ("Sat" || "Sun"))
- document.getElementById("endDay").style.visibility = "hidden";
- return checkFirstTime();
- }
- function isEndOfMonth() {
- if (firstMoment[2] === ("30" || "31")) {
- // Figure out end of month and think about leap years...
- }
- return isFriday()
- }
- isEndOfMonth();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement