自定义日期 AntD 日历 [英] Customize day AntD calendar

查看:61
本文介绍了自定义日期 AntD 日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 AntD 日历中自定义日期名称.对于星期日,Su"需要显示Sun".有什么办法吗?

I need to customize day name in AntD calendar. For Sunday, instead "Su" needs to show "Sun". Is there any way?

谢谢.

推荐答案

对我来说,它的工作原理是使用 momentjs 在正确的属性上设置我想要的信息:

For me it worked by setting the information I wanted on the correct property using momentjs:

<Calendar 
   locale={{ 
      lang: { 
         locale: 'en', 
         dayFormat: moment.updateLocale('en', { 
                    weekdaysMin: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
         }) 
       } 
    }} 
/>

这篇关于自定义日期 AntD 日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆