File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Holiday in date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Holiday in date" Watch "Holiday in date" New topic
Author

Holiday in date

Kristol Crawley
Greenhorn

Joined: Sep 17, 2003
Posts: 7
Is it possible to tell if the date is a holiday? I looked through the api for calendar (we're on 1.3.1 btw) and I didn't see anything that looked like it would return that.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Java does not provide this functionality automatically. It will require some work on your part. Check out JavaWorld's Tips 'N Tricks Java Tip 44: Calculating holidays and their observances for some more info.
Kristol Crawley
Greenhorn

Joined: Sep 17, 2003
Posts: 7
I figured it'd be messy!
Thank you Jason!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
here's one I was working on some time ago (I'm not from the US so I'm not entirely sure I have the parameters of the holidays correct)
easter calculation is close, but is incorrect (this is when I stopped), you might be able to add a tweak or two, to get it right.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Holiday in date
 
Similar Threads
WA #1.....word association
display only 2 rows from a recordset size of 10
java.util.Date for any year
How to check a date as 'holiday' in java
how to change color of a date in calendar