wasimshaikh / php-calendar

Automatically exported from code.google.com/p/php-calendar
1 stars 0 forks source link

Week number not right #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i've noticed the date is correct but the week number is 1 to high

for example today 8th of july 2011 is week 27
php-calendar gives week 28

Original issue reported on code.google.com by tdnijboe...@gmail.com on 8 Jul 2011 at 1:56

GoogleCodeExporter commented 9 years ago
What country are you from? If you start your weeks on Monday, please change 
that and you should see appropriate week numbers. If you are from the US, 
please see http://en.wikipedia.org/wiki/Seven-day_week#Week_numbering , your 
calendar or that article is wrong.

Original comment by sproctor@gmail.com on 8 Jul 2011 at 3:24

GoogleCodeExporter commented 9 years ago
i live in holland, and i have set the week start at sunday.

but it's not just my website,
i've also noticed it on you're demo page.

don't know if it mathers but i forgot to metion i use the 2.0beta10 version.

Original comment by tdnijboe...@gmail.com on 8 Jul 2011 at 3:27

GoogleCodeExporter commented 9 years ago
Really? I thought Europe was all Monday. Well. Here's a quick fix: in 
includes/calendar.php, line 277-ish (in the function week_of_year()), change 
the line "if(get_config($phpcid, 'week_start') == 1) {" to "if(true) {"

I'm not even sure that that will be entirely correct. How do you determine week 
numbers in Holland? ISO (which is most of Europe) is the week with the first 
Thursday, but they start weeks on Monday. So Is it just the first week with at 
least 4 days? (So first Wednesday?) USA/Canada are the week with the first 
Saturday (which is just the first week of the year with any amount of days).

Original comment by sproctor@gmail.com on 8 Jul 2011 at 6:24

GoogleCodeExporter commented 9 years ago
thanks for the fix.
for the record it was line 312 (in case anyone else needs it!)

and you are right, weeks start at monday.
but i like calanders where the weekend is on both sides of the screen.

i have absolutly no idee how weeknumbers are created.
in fact i don't do that much with week numbers, if i need them i look at the 
ubuntu calander (wink)
sorry i can help you with that!

Original comment by tdnijboe...@gmail.com on 9 Jul 2011 at 7:37

GoogleCodeExporter commented 9 years ago
I think this is fixed. Closing it. Reopen on github 
https://github.com/sproctor/php-calendar/issues/new if it's not.

Original comment by sproctor@gmail.com on 22 Apr 2013 at 9:14