I need to know the date for last Sunday for given date in php & javascript
Let\'s have a function give_me_last_Sunday
Ok so this is for JavaScript only. You have an input that you need to extract the month, date, and year from. The following is just partly an answer then on how to get the date:
So the setFullYear function sets the myDate to the date specified where the first four digits is the year, the next are is the month (0= Jan, 1= Feb.,...). The last one is the actually date. Then the above code gives you the date of the Sunday before that. I am guessing that you can add more code to get the month (use getMonth() method). Here are a few links that might be helpful
(You can probably find the other functions that you need)
I hope this helps a bit even though it is not a complete answer.