Babajide Prince Babajide Prince - 11 months ago 137
Java Question

GWT Date equivalent to java.util.Calendar

I want to get the date of a particular day of the week e.g Wednessday. i.e If today's date is 27th Friday, Wednessday would infact be the 25th .

I could achieve this by

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
String thisWed = String.format("%tF%n", calendar)

The challenge here is that
is not supported in GWT client side, Is there a possible solution without having to move this code to server side ?


Answer Source is what you are looking for, I guess;