Groovy web console

subscribe to the feed Subscribe
to this
site
BijnaWeekend (via #groovywebconsole)
tweet this snippet Tweet
this
script

BijnaWeekend

Published 3 months ago by CBlanken with tags Weekend
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def weekendvraag = "Is het al weekend?"
def weekend = "Ja"
def geenweekend = "Nee"
def noggeenweekend = "Bijna"
def Datetime = new Date();
def a = Datetime.format("EEEE");
def b = Datetime.format("HH").toInteger();
println("Time of System: "+Datetime.toString());
def result;
 switch (a) {
    case "zaterdag" : result = weekend;
    break
    case "zondag":  result = weekend;
     break
      case "vrijdag": 
       switch (b) {
         case 13..15:  result =noggeenweekend
         break
           case 16..24:  result =weekend
         break
           default:
           result = geenweekend;
         }
     break
    default:
     result = geenweekend;
      break
 }
 
 println (weekendvraag);
 println(result);