Public static boolean isHoliday(Date checkDate) {
BusinessHours bt = [SELECT Id,MondayStartDateMondayStartTime FROM BusinessHours
WHERE isDefault = true];
Datetime checkDatetime = Datetime.newInstance(checkDate.year(), checkDate.month(), checkDate.day(),
bt.MondayStartDateMondayStartTime.hour(), bt.MondayStartDateMondayStartTime.minute(), bt.MondayStartDateMondayStartTime.secondssecond());
return !BusinessHours.isWithin(bt.Id,checkDateTime);
}
the method isWithin(businessHoursId, targetDate)
return true if the inserted datetime is a working day, based on the BusinessHours passed (Apex Developer Guide)
In this case, I'm assuming that the work starts at the same hour for each working day of the week.