Ant Design Calendar: How to Change the Day of Week Format

旧时模样 提交于 2020-01-24 19:22:49

问题


I'm using the Ant Design Calendar Component in my project and I have it set up as follows:

Currently the Day of Week format is dd. Eg. Su, Mo, Tu, etc.

Is it possible to change the format via props to ddd. Eg. Sun, Mon, Tue, etc.?


回答1:


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"]
});


来源:https://stackoverflow.com/questions/59069572/ant-design-calendar-how-to-change-the-day-of-week-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!