We can calculate the number of week, just by knowing the number of days and just divide that by 7.... u will be able to calculate the weeks.
What I want to say is suppose user enter 2/27/2010 i.e 2nd february 2010..... from this we will be able to calculate the number of days till 2nd february 2010. suppose it come out to be 45 days ..........when we will divide 45/7 = 6 so it can it calcualted the weeks of the year can be known....
I had also thought so, but if then I go to check indeed on the calendar, the week n. 6 are that that begins 8/02/2010 and it ends 13/2/2010. There is then something that doesn't square.. because it needs besides to remember whether to have the 52 weeks a year, if the first week of the year not inzia with Monday is counted as week 0 rather than week 1.
1 person found this helpful
Take a look at the DateUtils library ( http://flexdateutils.riaforge.org/ ); it should have methods to get you the week of the year.
If not, drop me a line privately; because I wrote a lot of new methods to that class for the Flextras Calendar. I just haven't gotten around to donating them back to the project yet.
And I'll add; if you want to create a Calendar Application; be sure to check out our Calendar Component. I'm sure it'll save you tons of time.
Use the time instead.
First week of the year will be 1 january YEAR no matter what. Create a new Date object with 1 january and the current year.
Make a difference with the current time ( new Date().time ) and divide by WEEK_IN_MS.
Is this enough for you ?
Thanks to all!!! Now I try!