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.