Ant Design日历:如何更改星期几格式 [英] Ant Design Calendar: How to Change the Day of Week Format
本文介绍了Ant Design日历:如何更改星期几格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在项目中使用 Ant Design日历组件,并且将其设置为如下:
I'm using the Ant Design Calendar Component in my project and I have it set up as follows:
当前星期几"格式为dd
.例如. Su
,Mo
,Tu
等
Currently the Day of Week format is dd
. Eg. Su
, Mo
, Tu
, etc.
是否可以通过道具将格式更改为ddd
.例如. Sun
,Mon
,Tue
等?
Is it possible to change the format via props to ddd
. Eg. Sun
, Mon
, Tue
, etc.?
推荐答案
不支持直接在ant设计组件上进行更改,
但是引擎盖下的Ant Design使用的是moment
,而locale.weekdaysMin
使用的是locale.weekdaysMin
,因此您可以导入moment
并进行更改:
There is no support for changing that directly on ant design component,
but Ant Design under the hood is using moment
which is using locale.weekdaysMin
, so you can import moment
and change them:
import moment from 'moment'
moment.updateLocale('en', {
weekdaysMin : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
});
这篇关于Ant Design日历:如何更改星期几格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文