-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
DatePicker the week starts on Sunday in some counties the weeks starts on Monday is there a way to change this? #6449
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
Comments
Thank you for your issue. I'll look into it in the future. |
Hello,you should do this to complete your custom dayjs functionality, import the plugin, and register the plugin. I will update the documentation here, thanks for the issue. import en from "dayjs/locale/en"
// ...
import updateLocale from "dayjs/plugin/updateLocale";
dayjs.extend(updateLocale);
dayjs.updateLocale("en", {
weekStart: 1,
}); |
Unfortunately that makes no difference. Sunday is still the first day of the week. Down below you see my component code. Component (DateRange.vue)
|
import dayjs from 'dayjs';
import enUS from 'ant-design-vue/es/locale/en_US';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import localeNL from "ant-design-vue/es/locale/nl_NL";
import localeES from "ant-design-vue/es/locale/es_ES";
import localeFR from "ant-design-vue/es/locale/fr_FR";
import localeDE from "ant-design-vue/es/locale/de_DE";
import updateLocale from "dayjs/plugin/updateLocale";
dayjs.extend(updateLocale);
function updateLocaleWithLangs(langs: any[]) {
langs.forEach((lang) => {
dayjs.updateLocale(lang.locale, {
weekStart: 1,
mondayFirst: true,
});
});
}
updateLocaleWithLangs([zhCN, enUS, localeNL, localeES, localeFR, localeDE]); |
Fixed it by: For mondayFirst: true can be removed also Thanks for your help! Working code
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
3.2.16
Environment
Vue 3.2.45
Steps to reproduce
Open the date range picker and you see the first day of the week is Sunday would be nice to make it possible to change this to Monday. In the react version this is possible. See https://ant.design/components/date-picker at the bottom.
What is expected?
dayjs.updateLocale('en-UK', {
weekStart: 1,
});
What is actually happening?
No support for updateLocale weekStart
The text was updated successfully, but these errors were encountered: