Rinku,
I don't really think you'd want to attempt to rewrite the whole
java date/calendar libraries! The easiest thing for you to do would be to use the java.util.Calendar (get an instance by calling the static Calendar.getInstance() method).
Calendar has a function Calendar.get(int) which can be used to get the day of week ( mon,tues,...) by using as getInstance(DAY_OF_WEEK). This factors in leap years etc so you don't have to worry about that. It would be very easy to write a function that accepts any date and produces the first and last day of that week by subtracting/adding the appropriate number of days based on the "day of week" obtained using the function above.
Akanimo.
[This message has been edited by Akanimo Udoh (edited July 10, 2001).]