on 12-03-2007 7:39 AM
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);
I think that you need to post this question in the ABAP forum.
Regards,
Graham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.