In my application there lies a code which works abruptly sometimes, its about getting a week interval using the java calendar object through Calendar.DAY_OF_WEEK. The code checked for monday as start of week and sunday as end of week like: fromCal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); toCal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); the toCal is set as the last sunday instead of coming sunday. Is there any alternate way to do this other then this kind of hard coding.
Appriciate the help in advance.
Thanks,
Vaibhav