date-holidays icon indicating copy to clipboard operation
date-holidays copied to clipboard

Technically every sunday is a holiday in `DE-HE`

Open leipert opened this issue 8 years ago • 3 comments

This is not fixed in #12:

Technically every sunday is a holiday in DE-HE.

Public holidays are the sundays and [...] Source: http://www.datumsrechner.de/gesetze/Hessen.pdf

I do not know how you want to handle this.

leipert avatar May 03 '17 20:05 leipert

Sorry, there is no rule for that yet. I don't know if this is really of relevance in this lib as it would "pollute" the real information a user would like to see. Legally seen the it would be correct to show each Sunday in the list. I am undecided in this case.

commenthol avatar May 06 '17 18:05 commenthol

I agree with @commenthol that it would be a kind of pollution. But i need the option to declare the sundays as holiday too. Or just to check if the selected date is a sunday. Is there any option for this?

edit i've hacked it with the following

var calendarConfig = {
  onChange: [
        // Check Holiday and alert the extra charge information
        function(selectedDates, dateStr, instance){
            if(hd.isHoliday(new Date(dateStr)) || selectedDates.toString().indexOf("Sun") === 0 ){
                ....
         }
}

works for me with the single date selection. didnt tested it with range/multi dateselect

Maybach91 avatar Jun 06 '17 14:06 Maybach91

@Maybach91 No there is no such option. As you are checking date by date I would recommend to use the new Date(dateStr).getDay() === 0 comparison instead of checking the localized string.

commenthol avatar Jun 07 '17 15:06 commenthol