Created
October 15, 2013 11:06
-
-
Save chriswk/6989970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (pbp.getDuration() > 0) { | |
setEndDate(null); // The stored procedure will figure out the end date given the product's duration | |
final DateMidnight today = new DateMidnight(); | |
setStartDate(new Date(today.getMillis())); | |
} else { | |
if (adBean.getStartDate() != null) { | |
setStartDate(adBean.getStartDate()); | |
} else { | |
final DateMidnight today = new DateMidnight(); | |
setStartDate(new Date(today.getMillis())); | |
} | |
if (adBean.getEndDate() != null) { | |
setEndDate(adBean.getEndDate()); | |
} else { | |
// Will be configured again later | |
final DateMidnight today = new DateMidnight(); | |
setEndDate(new Date(today.getMillis())); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Date today = new Date(new DateMidnight().getMillis()); | |
if (pbp.getDuration() > 0) { | |
setEndDate(null); // The stored procedure will figure out the end date given the product's duration | |
setStartDate(today); | |
} else { | |
Date startDate = Optional.fromNullable(adBean.getStartDate()).or(today); | |
setStartDate(startDate); | |
Date endDate = Optional.fromNullable(adBean.getEndDate()).or(today); | |
setEndDate(endDate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment