java


Calculate business days difference between two days excluding holidays?


I already have a list of holidays which is a List .
Given two Date object, how could I calculate the difference in working days (not counting weekends and holidays) between them?
I have found the library ObjectLab Kit but I think it only knows how to advance days.
Thanks
I found Jollyday useful in earlier projects.
Probably not the most efficient way, but probably fast enough: loop starting with the earliest date, add a day at each iteration until the end date, and increment a counter unless the current day is a weekend or a holiday.
java.util.Calendar is the class to use. It has method to add a day to itself and check if it's a saturday or a sunday.

Related Links

Splitting up the drawing of a GUI Element
How can you force recompilation of jsps in JBoss 4.2?
How do I save Eclipse launch profiles across workspaces?
GWT with a Content Management System
What is the third boolean state in java?
How do I use JUnitPerf with JWebUnit and JUnit 4?
Messaging solution for a serial hardware device
What are all the different ways to create an object in Java?
How do I force a Java subclass to define an Annotation?
Java Serialization with non serializable parts
Differences between MSIL and Java bytecode?
How does jstl's sql tag work?
Java: Best Place to Begin Learning Basic Networking [closed]
Eclipse Custom Variable for Java Code Templates
How do the Proxy, Decorator, Adapter, and Bridge Patterns differ?
How can I search a graph for a path?

Categories

HOME
log4j
client
keycloak
magnific-popup
image-processing
azure-data-factory
react-virtualized
view
office365api
rsyslog
youtube-api-v3
dax
aurigma
jtextfield
errorlevel
sox
extjs5
autosys
fish
pepper
ping
xacml
windows-server-2000
bpel
semantic-versioning
google-qpx-express-api
mmenu
qwerty
libraries
ssjs
uft-api
mesos-chronos
arena-simulation
no-www
turbogears
websphere-mq-fte
babel-core
termination
komodoedit
ionicons
alphabet
gabor-filter
yii2-extension
composite-key
sqlclient
capacity
memory-alignment
pintos
nested-sets
color-picker
instant
intrusion-detection
ctest
prettytensor
nessus
ios4
wapiti
lib.web.mvc
libressl
kcachegrind
tarjans-algorithm
cisco-ios
angular-local-storage
bridge.net
gadt
gui-test-framework
phalanger
asp.net-web-api-odata
terminfo
openexr
sgen
p4java
random-seed
sharp-repository
bitsharp
broken-links
dice
whoosh
external-accessory
xmlspy
django-tagging
horizontal-accordion
recent-documents
locate
yslow
mozilla-prism
forums
mirah
backcolor
mediarss
genealogy

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App