Hey guys I need an help regarding Calendar functions.
As i am beginner in netweaver...
i was able to display the system date n time
but the problem is that i want the previous and next week dates.
the code which i have done is as follows which moves only one week previous n next...
i want it to move successively previous n next....plz help
thanx in advance.....
Calendar cal = Calendar.getInstance();
java.sql.Date sqlDate1 = new java.sql.Date(cal.getTime().getTime());
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setMinimalDaysInFirstWeek(1);
cal.set(Calendar.WEEK_OF_YEAR, wdContext.currentContextElement().getSweek()-1);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
java.util.Date weekDate = cal.getTime();
DateFormat formatter = DateFormat.getDateInstance(3);
String result = formatter.format( weekDate);
cal.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
java.util.Date weekDate1 = cal.getTime();
DateFormat formatter1 = DateFormat.getDateInstance(3);
String result1 = formatter.format( weekDate1);
wdContext.currentContextElement().setWeek(result" to "result1);
Add a comment