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

enh(NcDatetimePicker): convert lang computed value to prop #3941

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

st3iny
Copy link
Contributor

@st3iny st3iny commented Mar 29, 2023

Required for nextcloud/calendar#4259

This allows to overwrite the locale configuration of the upstream date picker library. Some apps (e.g. Calendar) overwrite some of the default values which are specified here.

https://github.com/nextcloud/calendar/blob/90f4f29204a95a49daa3961e33addf80f5720e7e/src/components/Shared/DatePicker.vue#L24

This allows to overwrite the locale configuration of the upstream date
picker library. Some apps (e.g. Calendar) overwrite some of the default
values which are specified here.

Signed-off-by: Richard Steinmetz <[email protected]>
@st3iny st3iny added enhancement New feature or request 3. to review Waiting for reviews feature: datepicker Related to the date/time picker component labels Mar 29, 2023
@st3iny st3iny self-assigned this Mar 29, 2023
st3iny added a commit to nextcloud/calendar that referenced this pull request Mar 29, 2023
This is just a workaround.
Real fix at nextcloud-libraries/nextcloud-vue#3941

Signed-off-by: Richard Steinmetz <[email protected]>
st3iny added a commit to nextcloud/calendar that referenced this pull request Mar 29, 2023
This is just a workaround.
Real fix at nextcloud-libraries/nextcloud-vue#3941

Signed-off-by: Richard Steinmetz <[email protected]>
@skjnldsv
Copy link
Contributor

Why can't this be fixed here instead of in calendar then?

@st3iny
Copy link
Contributor Author

st3iny commented Mar 30, 2023

Why can't this be fixed here instead of in calendar then?

Now, this would be ideal but is not possible atm.

The problem is about the firstWeekContainsDate setting from the upstream library. It depends on the current locale which is not accessible from within nextcloud/vue. In calendar we use moment js to get this setting (moment.localeData(locale).firstDayOfYear()).

This is the reason I need to propagate custom locale/language settings based on the user's locale.

Ref mengxiong10/vue2-datepicker#566 (comment)

st3iny added a commit to nextcloud/calendar that referenced this pull request Mar 30, 2023
This is just a workaround.
Real fix at nextcloud-libraries/nextcloud-vue#3941

Signed-off-by: Richard Steinmetz <[email protected]>
backportbot-nextcloud bot pushed a commit to nextcloud/calendar that referenced this pull request Mar 30, 2023
This is just a workaround.
Real fix at nextcloud-libraries/nextcloud-vue#3941

Signed-off-by: Richard Steinmetz <[email protected]>
backportbot-nextcloud bot pushed a commit to nextcloud/calendar that referenced this pull request Mar 30, 2023
This is just a workaround.
Real fix at nextcloud-libraries/nextcloud-vue#3941

Signed-off-by: Richard Steinmetz <[email protected]>
@skjnldsv skjnldsv merged commit 8aca55a into master Mar 31, 2023
@skjnldsv skjnldsv deleted the enh/noid/date-time-picker-lang-prop branch March 31, 2023 06:51
@skjnldsv skjnldsv mentioned this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: datepicker Related to the date/time picker component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants