The answer that Google seems to use (currently), is:
@SuppressWarnings("deprecation") // GWT requires Date
public static void addDaysToDate(Date date, int days) {
date.setDate(date.getDate() + days);
}
This is from the class com.google.gwt.user.datepicker.client.CalendarUtil
, which is used by com.google.gwt.user.datepicker.client.DatePicker
. I imagine, that there will be problems involved, when doing calculations in different timezones.
Lots of people have already voted for some kind of Joda time for GWT: http://code.google.com/p/google-web-toolkit/issues/detail?id=603 . The currently last comment states, that there's a new fork of goda time, maybe we should really check it out.