I have a list of dates that I want to ignore:
private val excludeDates = List(
new DateTime("2015-07-17"),
new DateTime("2015-07-20"),
new DateTime("2015-07-23")
)
But I always need to display four dates, with the exception of my blacklist of Dates and weekends. So far, with the following code, my counter is incremented when I click on an ignored date, and this creates a feeling. So, how can I go to the next date until I press 4 dates not on my black list and my days off? Maybe for a while, but I don't know how to add it to scala code:
1 to 4 map { endDate.minusDays(_)} diff excludeDates filter {
_.getDayOfWeek() match {
case DateTimeConstants.SUNDAY | DateTimeConstants.SATURDAY => false
case _ => true
}
}
source
share