配置El-date-ficker
有人知道,如何在Element-Plus中配置El-Date挑选以设置一周的第一天。
文档说它可以通过day.js配置,但不使用emporture day.js中的元素中的configure。
到目前为止,我已经做到了。
import de from 'element-plus/es/locale/lang/de';
const i18n = createI18n({
legacy: false,
locale: 'de',
messages: {
'de': messagesDe
},
datetimeFormats: {
'de': {
short: {
year: 'numeric',
month: '2-digit',
day: '2-digit'
},
long: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
}
}
},
});
app.use(ElementPlus, {
locale: de,
});
app.use(i18n);
感谢您的帮助。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“ nofollow noreferrer”> oraround
dayjs#dayjs#215
也适用于元素加。例如,要将星期一设置为
de
语言环境的一周中的第一天,请创建de
对象,dayjs.ls
和SETWeekStart = 1
:demo
The workaround described in
dayjs#215
also works for Element Plus.For example, to set Monday as the first day of the week for the
de
locale, create ade
object off ofdayjs.Ls
, and setweekStart=1
:demo
对我而言,仅在main.ts中使用此配置:
For me worked only with this configuration in main.ts:
Link to dayjs locale documentation