Skip to content

Commit

Permalink
allow Date arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dierk Koenig committed Nov 1, 2019
1 parent 1b4b44d commit 0d76458
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions grails-app/init/webec/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ class BootStrap {
Room oben = new Room(name:"1.313", capacity: 60).save(failOnError:true)
Room unten = new Room(name:"5.2B16", capacity: 6).save(failOnError:true)

use(DateGroovyMethods) {
Date today = new Date().clearTime();

Date today = new Date();
for (int i=0; i<100; i++) {
new Booking(booker: dierk, room: oben, day: today + i, slot: Booking.AM).save(failOnError:true)
}

for (int i=0; i<100; i++) {
new Booking(booker: dierk, room: oben, day: today, slot: Booking.AM).save(failOnError:true)
}

new Booking(booker: dierk, room: oben, day: today, slot: Booking.AM).save(failOnError:true)

}

}
def destroy = {
Expand Down

0 comments on commit 0d76458

Please sign in to comment.