Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add a week number calendar to iCal Apps
Frustrated by the lack of week number support in iCal, I started searching for a solution. I stumbled upon a PHP script that generates a calendar with week numbers for Google Calendar. I changed this PHP script to make it output an iCal week numbers calender instead. Here's the modified version.

Usage:

Copy the PHP script, save it as generate_weeks.php or whatever, and run it. Save the resulting calendar with an .ics extension. Create a new calendar in iCal, called something like week numbers, select it, go to File -> Import, and import the generated .ics file.

For people that don't have PHP at their disposal, you can download the 2007 and 2008 calendars. You now have a calendar that displays the week numbers above the weeks.

[robg adds: I also created an archive with the PHP script and the two calendars. To run the PHP script, just type php scriptname.php in Terminal.]
    •    
  • Currently 3.50 / 5
  You rated: 3 / 5 (8 votes cast)
 
[60,330 views]  

Add a week number calendar to iCal | 9 comments | Create New Account
Click here to return to the 'Add a week number calendar to iCal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add a week number calendar to iCal
Authored by: umijin on Jan 05, '07 08:19:05AM
You might also try this freeware app called 'NumSemaine' which apparently does the same thing. Go here: http://home.tele2.fr/zeldaprod/

The site is French, but I recall the download has an English explanation.

[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: ianeiloart on Jan 05, '07 08:30:09AM

Are these ISO week numbers, or US week numbers, or something else? Week numbers vary around the world, and if week numbers matter to you, it's important that you're using the same system as you colleagues.

---
--
Ian Eiloart



[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: hamarkus on Jan 05, '07 09:21:48AM

Have a look at the script itselfs, it says 'Europe, week starting Monday' in there. I don't know what else is different between Europe and the US. Maybe how to treat years where the 1 January is a Thursday but I guess if you look at the code you will be able to figure out how the script treats such a case.



[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: dbunskoek on Jan 05, '07 10:15:59AM
The script uses the PHP date() function to generate the week numbers, using 'W' as its format string.

It says in the PHP documentation:

W: ISO-8601 week number of year, weeks starting on Monday

([link:]http://www.php.net/manual/en/function.date.php)



[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: jervidalo on Jan 05, '07 10:35:31AM
The strange thing is that if you try to print a calendar from iCal (in week view), it does contain week numbers. Pretty strange, seems almost like Apple just "forgot" to include it...

[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: jLo on Jan 06, '07 02:53:05AM
Have no idea what standard this is, but you can subscribe to this Norwegian site to get week numbers:

http://www.dreier.no/ical/weeknumbers.ics

First week starts on Jan. 1 it seems. No guarantees from my side on how long this will be maintained either - gives numbers one year ahead as of now.

[ Reply to This | # ]
Add a week number calendar to iCal
Authored by: semiotek on Jan 06, '07 03:59:13AM

I've been using a similar Danish site for some years now.

That week one started on 1 January this year is only because it was a Monday - it was a Sunday last year, and week one began on 2 January.



[ Reply to This | # ]
Request: Flexible week # & beginning day of week
Authored by: belaf on Jan 06, '07 01:20:58PM

This would be a useful function for me, but it would be more so if the starting day and week could be set to suit the user's needs. In my case the (fiscal) year starts Oct 1 and the week starts on Sunday. Thus, I would like the 2007 weeks to start on the last Sunday of 2006, designated week 14. If I knew more about programming I would play with the code, but it's not obvious to me how it should be changed.

Bela



[ Reply to This | # ]
Request: Flexible week # & beginning day of week
Authored by: abadr on Feb 06, '07 04:47:40PM
Bela,

See the link above:

http://home.tele2.fr/zeldaprod/numsemaine-eng.html

This is a great little app.

Registered especially for you, as I was in the exact same situation ;)

[ Reply to This | # ]