views:

331

answers:

2

I want to pass a date object into a function and determine what the first date of that week was.

Example: If I pass in today's date (2009/06/24) I want the function to return what the first date of this week was, i.e. Sunday's date was 2009/06/21 so it must return that.

Anyone know of any standard javascript function that does that? Thanks

+1  A: 

this link help to see what is the day in the week you need to calculate the first day : http://www.webdevelopersnotes.com/tips/html/getting_current_time_using_javascript.php3

Haim Evgi
thanks for the answer but I found a more complete answer on another StackOverFlow question
FailBoy
your welcome :)
Haim Evgi