Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Technically every sunday is a holiday in DE-HE #14

Open
leipert opened this issue May 3, 2017 · 3 comments
Open

Technically every sunday is a holiday in DE-HE #14

leipert opened this issue May 3, 2017 · 3 comments

Comments

@leipert
Copy link
Contributor

leipert commented May 3, 2017

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.

@commenthol
Copy link
Owner

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.

@Maybach91
Copy link

Maybach91 commented Jun 6, 2017

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

@commenthol
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants