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

Add holidays in lieu #10

Merged
merged 5 commits into from
Jan 10, 2023
Merged

Add holidays in lieu #10

merged 5 commits into from
Jan 10, 2023

Conversation

koterpillar
Copy link
Contributor

Add, not replace, holidays in lieu; fix consecutive holidays

Whenever a holiday falls on a weekend, show both weekend (actual date) and replacement (observed date).

Fix consecutive holidays such as Christmas Day and Boxing Day so that observed dates are correct.

Tested with Australian and UK holidays. I'm not familiar with the rules in other countries, they might need an update for consistency.

Fixes #7.

@hvianna
Copy link
Owner

hvianna commented Jan 8, 2023

Thanks for this! Will have a look at it as soon as I have a chance.

@hvianna hvianna changed the base branch from master to dev January 9, 2023 23:59
Whenever a holiday falls on a weekend, show both weekend (actual date)
and replacement (observed date).

Fix consecutive holidays such as Christmas Day and Boxing Day so that
observed dates are correct.

Tested with Australian and UK holidays.
js/holidays.js Outdated
Comment on lines 408 to 418
var observedName = options.observedName;
if ( !observedName ) {
switch ( country ) {
case 'au':
observedName = `Additional public holiday for ${name}`;
break;
case 'uk':
observedName = `${name} (in lieu)`;
break;
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think we could simplify this by just adding "(observed)" to the original holiday name, as you proposed in #7?
The actual text could be a string in the translations object and we would do it for all countries which have observed holidays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went by the official names for Australia. UK seems to disagree; I'm happy to put "in lieu" for both.

However, the holiday names themselves aren't translated, so it doesn't make sense to translate "in lieu". (Does "Año Nuevo (in lieu)" look good?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From a quick look, doesn't seem like there is an official spelling. Will you be happy with "(in lieu)" added only in AU and UK?

Copy link
Owner

Choose a reason for hiding this comment

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

Both AU and UK seem to use "substitute day" in those pages. I remember seeing "observed" in US calendars.
You have a point with the holiday names, but "Año Nuevo (in lieu)" looks weird to me. I think we either use the same language of the holiday name or the language selected for the calendar.

Copy link
Owner

Choose a reason for hiding this comment

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

From a quick look, doesn't seem like there is an official spelling. Will you be happy with "(in lieu)" added only in AU and UK?

I think we can do this for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All fixed.

js/holidays.js Show resolved Hide resolved
js/holidays.js Outdated Show resolved Hide resolved
@hvianna hvianna merged commit 4038713 into hvianna:dev Jan 10, 2023
@koterpillar koterpillar deleted the holidays-in-lieu branch January 10, 2023 20:30
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.

Christmas Day shifted onto Boxing Day (UK)
2 participants