Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isOnline() {
- window.addEventListener('load', function(e) {
- if (navigator.onLine) {
- return true;
- } else {
- return false;
- }
- }, false);
- }
- function sayDate() {
- var d = new Date();
- var y = d.getFullYear(); // year
- var m = d.getMonth();
- var da = d.getDate();
- var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
- var curMon = months[m];
- if (da == 1) {
- suffix = "st";
- } else if (da == 2) {
- suffix = "nd";
- } else if (da == 3) {
- suffix = "rd";
- } else if (da == 4) {
- suffix = "th";
- } else if (da == 5) {
- suffix = "th";
- } else if (da == 6) {
- suffix = "th";
- } else if (da == 7) {
- suffix = "th";
- } else if (da == 8) {
- suffix = "th";
- } else if (da == 9) {
- suffix = "th";
- } else if (da == 10) {
- suffix = "th";
- } else if (da == 11) {
- suffix = "th";
- } else if (da == 12) {
- suffix = "th";
- } else if (da == 13) {
- suffix = "th";
- } else if (da == 14) {
- suffix = "th";
- } else if (da == 15) {
- suffix = "th";
- } else if (da == 16) {
- suffix = "th";
- } else if (da == 17) {
- suffix = "th";
- } else if (da == 18) {
- suffix = "th";
- } else if (da == 19) {
- suffix = "th";
- } else if (da == 20) {
- suffix = "th";
- } else if (da == 21) {
- suffix = "st";
- } else if (da == 22) {
- suffix = "nd";
- } else if (da == 23) {
- suffix = "rd";
- } else if (da == 24) {
- suffix = "th";
- } else if (da == 25) {
- suffix = "th";
- } else if (da == 26) {
- suffix = "th";
- } else if (da == 28) {
- suffix = "th";
- } else if (da == 29) {
- suffix = "th";
- } else if (da == 30) {
- suffix = "th";
- } else if (da == 31) {
- suffix = "st";
- }
- document.write(curMon + ', ' + da + '' + suffix + ', ' + y);
- }
- function getWeather() {
- if (isOnline()) {
- } else {
- var d = new Date();
- hours = d.getHours;
- if (hours >= 5 && hours =< 9) {
- time = "morning";
- } else if (hours ) {
- }
- if (!idiot) {
- document.write("Have a fantastic ")
- } else {
- document.write("Get to bed you idiot. You have to be up early tomorrow.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement