Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/model/entities/Reservation.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public long duration() {
}

public void updateDates(Date checkIn, Date checkOut) {
Date now = new Date();
if (checkIn.before(now) || checkOut.before(now)) {
//Date now = new Date(); <- Aqui, ele obtém o valor do computador. Existe uma maneira mais moderna de fazer isso usando 'get'
if (checkIn.before(getCheckIn()) && checkOut.before(getCheckOut())) {
throw new DomainException("Reservation dates for update must be future dates");
}
if (!checkOut.after(checkIn)) {
Expand Down