Skip to content

Draft: small fix for loading holidays correctly#8

Open
boekhorstb1 wants to merge 3 commits into
maintaina-com:FRAMEWORK_6_0from
boekhorstb1:updating-holidays
Open

Draft: small fix for loading holidays correctly#8
boekhorstb1 wants to merge 3 commits into
maintaina-com:FRAMEWORK_6_0from
boekhorstb1:updating-holidays

Conversation

@boekhorstb1

Copy link
Copy Markdown

Problem:
One can add a holiday calendar, then untoggles. After this it is possible to add the same calendar again. One can repeat this process for an infinite untoggled identical holliday calendars.

Solution:
Adds a simple check.

Note: This does not solve the fact that holiday calendars have to be installed by pear, as mentioned in this issue.

@boekhorstb1

Copy link
Copy Markdown
Author

Please check @midahp @ralflang

Comment thread js/kronolith.js Outdated
Comment on lines +3857 to +3858
let check = this.getCalendarList(data.type).textContent.replace(/[^\w\s]/gi, '');
if (check === data.driver){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work if you already have multiple holiday calendars?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! will fix that

@ralflang
ralflang self-requested a review January 24, 2023 08:58
Comment thread js/kronolith.js Outdated
let check = this.getCalendarList(data.type).textContent.replace(/[^\w\s]/gi, '');
if (check === data.driver){
let check = this.getCalendarList(data.type).textContent;
if (check.includes(data.driver)){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will still fail if a calendar named foobar exists and want to create a new calendar named foo right?

Maybe I am wrong. I did not test it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes true. Need to adapt for the fact that calendars have partly the same name, as in: Australia, AustraliaNWS and so on

@boekhorstb1

Copy link
Copy Markdown
Author

ok so I found a way to install this with composer, see this issue

@boekhorstb1 boekhorstb1 changed the title small fix for loading holidays correctly Draft: small fix for loading holidays correctly Jan 26, 2023
@boekhorstb1
boekhorstb1 force-pushed the updating-holidays branch 2 times, most recently from 2690314 to ed5a8cf Compare January 27, 2023 21:21
@ralflang

Copy link
Copy Markdown

Why is it a problem if one has the same holiday calendar twice?

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

Successfully merging this pull request may close these issues.

3 participants