-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hello, how to determine the date of the next 7 days in zkoss? help me please...
I asked about how to determine the date of payment if I want to start more than seven days after the date of this day for example: lending on Dec. 29, 2014 and then the payment should begin seven days after the date of the loan ?
i'm sorry, because my english conversation doesn't good, I do not speak English fluently
A nice library for calculating with date/time you can found here: joda time library
best Stephan
/**
* Add count of days to a given date.
*
* @param givenDate
* the given date..
* @param daysToAdd
* the count of days to add.
* @return Date
*/
public static Date addDays(final Date givenDate, final Integer daysToAdd) {
if (givenDate == null || daysToAdd == null) {
throw new UiException("date or days to add should not be NULL!");
}
DateTime currDate = new DateTime(givenDate);
DateTime newDate = currDate.plusDays(daysToAdd);
return newDate.toDate();
}
Asked: 2014-12-29 02:57:36 +0800
Seen: 12 times
Last updated: Dec 29 '14
Can you explain a little more what you are looking? You are asking about zk calendar component or how to determine a date in java?
cyiannoulis ( 2014-12-29 07:51:16 +0800 )edit