message resolution fix

This commit is contained in:
Keith Donald
2008-05-14 03:07:29 +00:00
parent 8f9ad87fc8
commit 7010a806a0
14 changed files with 122 additions and 192 deletions

View File

@@ -180,11 +180,11 @@ public class Booking implements Serializable {
public void validateEnterBookingDetails(MessageContext context) {
if (checkinDate.before(today())) {
context.addMessage(new MessageBuilder().error().source("checkinDate").defaultText(
"The Check In Date must be a future date").build());
} else if (!checkinDate.before(checkoutDate)) {
context.addMessage(new MessageBuilder().error().source("checkoutDate").defaultText(
"The Check Out Date must be later than the Check In Date").build());
context.addMessage(new MessageBuilder().error().source("checkinDate").code(
"booking.checkinDate.beforeToday").build());
} else if (checkoutDate.before(checkinDate)) {
context.addMessage(new MessageBuilder().error().source("checkoutDate").code(
"booking.checkoutDate.beforeCheckinDate").build());
}
}

View File

@@ -0,0 +1,2 @@
booking.checkinDate.beforeToday=The Check In Date must be a future date
booking.checkoutDate.beforeCheckinDate=The Check Out Date must be later than the Check In Date

View File

@@ -2,4 +2,4 @@ booking.checkinDate.typeMismatch=The Check In Date must be in the format dd/mm/y
booking.checkinDate.beforeToday=The Check In Date must be a future date
booking.checkoutDate.typeMismatch=The Check Out Date must be in the format dd/mm/yy
booking.checkoutDate.beforeCheckinDate=The Check Out date must be later than the Check In Date
booking.checkoutDate.beforeCheckinDate=The Check Out Date must be later than the Check In Date