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 locale-dependent handling of first day of week #781

Merged
merged 0 commits into from
Dec 5, 2022

Conversation

krakan
Copy link
Contributor

@krakan krakan commented Nov 29, 2022

Description

The Intl.Locale is a proposed standard that provides a way to get the first day of week based on locale or language.
This proposed standard is not yet fully supported by Firefox so in Firefox the first day of week will default to Monday (as specified in ISO-8601). (Switching static firstDayOfWeek = 1; to static firstDayOfWeek = 0; will make the default Sunday instead.)

Motivation and Context

In locales where Sunday is not the first day of week it is confusing that the calendar weeks look off by one.

Screenshots (if appropriate):

April and May 2022 in English
April and May 2022 in Swedish

Types of changes

  • Replay fix (fixes a replay specific issue)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added or updated tests to cover my changes.
  • All new and existing tests passed.

@tw4l tw4l self-requested a review November 29, 2022 16:30
@tw4l
Copy link
Member

tw4l commented Nov 29, 2022

Thanks @krakan ! This looks like a good change for a patch release of pywb.

The pywb/static/vue/vueui.js file is a build artifact built from the source code in pywb/vueui/. Would you mind refactoring this a bit to make the changes in the source code and then rebuild the static bundle from that? The development section of the contributing guide has some information on how to do that, but feel free to ask if you have any questions!

Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

Requested change: apply changes to source code rather than static build artifact

@krakan krakan requested a review from tw4l December 2, 2022 12:43
@krakan
Copy link
Contributor Author

krakan commented Dec 2, 2022

There's still an error though as can actually be seen in the screenshots: 2022-05-01 is a Sunday but is shown as Monday in the Swedish view.

@krakan
Copy link
Contributor Author

krakan commented Dec 2, 2022

There:
2022-12-02-150025_463x303_scrot

@tw4l tw4l changed the base branch from main to 2.7.1-dev December 5, 2022 16:48
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

thank you @krakan, this is looking great!

I'm merging this into our 2.7.1-dev branch and we will include the fix in the coming 2.7.1 patch release with attribution to you for the fix :)

@tw4l tw4l merged commit cac48bc into webrecorder:2.7.1-dev Dec 5, 2022
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.

2 participants