I\'d like to know if there is a jar-file out there that could do the following:
DateMidnight dateInQuestion = new DateMidnight(12,12,2000);
DateChecker.isNat
I also wrote a java wrapper around the Ruby Holidays Gem (. It's available on Github: https://github.com/gdepourtales/holidays. It works similar to Jollyday (http://sourceforge.net/projects/jollyday/).
My searching has brought up two results (in addition to what I listed in the comments). The first, the Holiday Client API, seems to be a dead project. The second, Jollyday, looks like a very rough, but active, work in progress.
As for why there is no good library, I'm with Tom. I suspect that your premise "Surely there are lots of properly based rules for the holidays in 99% of the times" is incorrect.
So far I haven seen any. But what I could suggest for u is to try to link with google calendar api, which from there try to get the holiday calendar through the calendar feed or whatever u call it. From there, process the data and if u want, save it into your database. Afterall, as long as you have a active internet connection, you can use java to connect to the relevant data Even for other languages, I dont think that such direct methods are available.
I found this interesting:
RESTful service provider - Holiday API
For Node projects - node-holidayapi
I know it is not relevent to the question asked for Java implementation. But if your project is RESTful (like most of the projects nowadays) then this would give you a place to start. ;)
I think you'll have to do the work yourself.
National holidays are determined by, well, nations. They can change, and are, by definition, not universal, and can thus not be captured by some algorithm.
The only way to keep track of them, is to maintain them on a per-nation basis.
Perhaps someone actually already does that (maybe a webservice of sorts), but I doubt it, to be honest.
I have written the Jollyday API and I'm interested to know what is so 'rough' about it. How can I improve it? Would be great to hear from you. Send me an email to sdiedrichsen@yahoo.de if you like.
By the way. Jollyday is used just the way as the questioner requests it. Please look for yourself.
Cheers, Sven
P.S.: I found a free webservice from Ulrich Hilger which provides detailed worldwide holiday info. Look at api.daybase.eu