Since GWT does not provide the GregorianCalendar class, how to do calendar operations on the client?
I have a Date a
and I want the Date, which is n
days after a
.
Examples:
a (2000-01-01) + n (1) -> 2000-01-02 a (2000-01-01) + n (31) -> 2000-02-01
Updated answer for GWT 2.1
final Date dueDate = new Date(); CalendarUtil.addDaysToDate(dueDate, 21);
Edit: the fully qualified name of this class is com.google.gwt.user.datepicker.client.CalendarUtil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With