Groovy web console

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

BijnaWeekend

Published 4 weeks 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(b);

def result;
 switch (a) {
    case "zaterdag" : result = weekend;
    break
    case "zondag":  result = weekend;
     break
      case "vrijdag": if(b>=15){ result =noggeenweekend} else result = geenweekend;
     break
    default:
     result = geenweekend;
      break
 }
 
 println (weekendvraag);
 println(result);