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

How to make inactive parts or views (Eclipse RCP 4) “closable with X-Button”
How should i resolve this ClassCastException?
Configure security schemas and contexts in Springfox and Spring MVC
how can i print this loop
Spring MVC application add stock to cart jsp JAVA
Outbound channel adapters in the same transaction
can we add multiple rows to existing table in word template using java
How to launch a <provider/> tag (Launching Shazam search activity)
“NoNodeAvailableExceptionException” thrown by class TransportClient
Transform AmazonS3 send to RX android observable
Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference [duplicate]
For what is the symbol $ after a variable in Java?
index_jsp.java uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details
Batch error sending push: Unable to send your test message: This push token was registered with a Sender ID that doesn't match this authorization key
Firebase populating recyclerview error: com.firebase.client.FirebaseException: Failed to bounce to type
Align lines with opening and closing brackets

Categories

HOME
maven
java
log4j
winforms
activiti
google-api-php-client
plone
appx
microservices
jsrender
gps
alpha
networkx
multiple-records
vifm
vault
resize
google-cloud-ml
gz
msp430
seaborn
progressive-web-apps
apache-metamodel
interop
csrf-protection
kudan
cultureinfo
claims-based-identity
lcd
firebase-crash-reporting
entitlements
applozic
tasklet
unboundid
junit5
hybridauth
geopositioning
mapbox-gl
revolution-slider
git-merge
hot-module-replacement
serverside-rendering
user-controls
squib
galen
nomethoderror
gpx
atomicity
errordocument
logparser
worksheet
font-size
django-scheduler
synchronous
smart-table
android-textview
radtreelist
independentsoft
energy
ford-fulkerson
spim
reactive-banana
cartesian-product
spidermonkey
event-bubbling
generic-programming
dereference
block-device
codeigniter-routing
java-metro-framework
openexr
aapt
transcoding
intentservice
gnu-smalltalk
access-rights
inbox
sqlperformance
itmstransporter
dmoz
mt
datawindow
javaspaces
viewswitcher
appconkit
wse3.0
qtkit
fireworks
data-loss
mod-auth
hamachi
xmemcached
recent-documents
zend-translate
paster
icanhaz.js
xsdobjectgen
vc90
audio-capture
ti-dsp
simpletest

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App