Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Calendar Example

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.?

like image 575
Barry Michael Doyle Avatar asked Dec 11 '22 01:12

Barry Michael Doyle


1 Answers

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"]
});
like image 152
StackedQ Avatar answered Dec 31 '22 13:12

StackedQ