views:

79

answers:

2

I want to make a little free calendar program to help me and others calculate how much time we have got left in a project. I mean real working time, not just time. Time in a raw form is not saying much.

Typically when my boss tells me that I have time until 05-05-2011 it doesn't tell me really how much time I have to do my job.

You know...so many things stop me from work:

A) beeing at home, not at work (so called "free time" or "spare time"). That is in my case I work exactly 8 hours a day and then the cleaning ladies throw me out of the office with their incredible loud industrial vacuum cleaners every evening (my boss accepts that as an excuse to go home in time, regularly).

B) weekends, or more precisely saturdays and sundays

C) official holiday rescuing me from having to go to work.

what I want to do is make a little utility which tells me how many working hours I really have in a given time period.

The first two things A and B are pretty easy to implement. But the last thing C scares my pants off. Holidays. OOOHHH man. You know what that means. Chaos. Pure chaos.

The huge question is: HOW TO CALCULATE HOLIDAYS?!

Since I want my program to be useful for anyone anywhere in the world, I can't just hardcode all holidays for my little town.

So which options do I have?

I) I could hand-craft downloadable lists of holidays. Users search them within the application and download them from an webserver. Or I ship all of them in the package. But I would get very, very old if I tried that by myself for every country, state and town.

II) I make an initial data sheet with holidays for my town, and don't care about the rest. However, I make that sheet with an how-to public, so that everyone who feels like beeing very nice can provide holiday data for his country / region / whatever. Those are made public on a webserver and everyone can get the data packages he/she needs for the app.

III) ?

I care a lot about usability. I don't want to make an ugly linux hack style hard to use app that only computer freaks can use.

So you need to tell me more about holiday science. I was never really clever at this. I assume every single country in the world has it's own set of holidays. In every country there may be several states. For example the US has some, and Germany has also some states. Holidays vary from state to state. But I know from an good programmer he told me never assume anything. So the questions about holiday science are:

  • Which categories do I need to make holiday-data-packs searchable? A guy from India should find quickly his holiday data pack, and a guy from Sillicon Valley should find his pack as equally fast. It makes most sense to me to filter for COUNTRY > STATE > WHATEVER. Like a drill-down-search. Did I miss something?

  • What would be the best data format to hold holiday information? A holiday has a start and end date and a name. That should be enough. Would I put all this stuff in thousands of XML files?

How would you go about this? Any hint / help is highly welcome! Thanks to everyone!

+2  A: 

We use a table.

It should not be that hard. If you look at your corporate holiday schedule you should be able to calculate the list of around 10 days. The only problem is that many of these are arbitrary. i.e Christmas falls on a Saturday so give the Friday before off.

Have you looked at this site to calculate the list of known Holidays ?

Many organizations post their holiday schedule on the web, it might be possible to read that and get the schedule ?

Romain Hippeau
You mean a database table? And every company has it's own set of holidays?? oh crap
A: 

In this case, I would suggest that you are encountering less of an engineering problem and more of a data collection problem.

Rather than define a "definitive set of holidays" for each possible user, allow the user to easily setup his holidays. By offering a (usable, quick, easy) way for users to select holidays, you do not make any assumptions.

You could even make it "social" by allowing users to upload their selections - imagine your HR department takes 10 minutes to setup and upload a set of holidays for all your company employees. Now you just need to provide a way for everyone to find that set.

On another topic, I would suggest using a common format, like iCal to store your calendar data. Here's a page with some example iCal files.

Jeff Meatball Yang
That's a good idea. But isn't iCal proprietary? I'm not sure if I am allowed to use such a format. Probably the safest thing would be to provide the data via XML, at least nobody would sue me at 3'clock in the morning when I'm still sleeping.
iCal is only a specification for encoding calender entries as a text file. It is definitely not proprietary. See my edits for more links.
Jeff Meatball Yang