PDA

View Full Version : How to subtract 180 days from current day



herleraja
1 Oct 2014, 1:06 AM
I used java.util.calender utility,

Date date = new Date();
toDate.setValue(date);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, -180);
date = cal.getTime();
fromDate.setValue(date);


but it is showing "No source code is available for type java.util.Calendar; did you forget to inherit a required module?"

This is because GXT not able to convert Java code into JavaScript.

so Please provide some way to set date 180 days from the current date .

Kachopsticks
1 Oct 2014, 7:23 AM
currentDate date = new Date();
fromDate date = newDate();
fromDate.setDate(currentDate.getDate() -180);


give that a try