javascript 周视图中的完整日历更改日期格式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12296525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 15:50:24  来源:igfitidea点击:

Full calendar change date format in week view

javascriptjqueryfullcalendar

提问by Ham

I'm using FullCalendar plugin for jQuery in my project. In fullCalendar week view, I can see a row showing the date in following format:-

我在我的项目中使用了 jQuery 的 FullCalendar 插件。在 fullCalendar 周视图中,我可以看到一行显示以下格式的日期:-

Sunday 9/6, Monday 9/7, Tuesday 9/8so on...

Sunday 9/6, Monday 9/7,Tuesday 9/8等等...

Actually, I wish to reverse the position of month/dayto day/month.

其实,我想扭转的位置month/dayday/month

How shall I initialize the setting? Thanks!

我应该如何初始化设置?谢谢!

回答by ganeshk

You need to use the columnFormatoption to customize this.

您需要使用该columnFormat选项来自定义它。

columnFormat: {
            month: 'ddd',
            week: 'ddd d/M',
            day: 'dddd d/M'
        }

Demonstrated in this fiddle. Let me know if this helps!

在这个小提琴中表现出来。如果这有帮助,请告诉我!

回答by zelazowy

Look at title_formatoption in fullcalendar documentation: http://arshaw.com/fullcalendar/docs/text/titleFormat/and set desired format in fullcalendar options.

查看title_formatfullcalendar 文档中的选项:http://arshaw.com/fullcalendar/docs/text/titleFormat/并在 fullcalendar 选项中设置所需的格式。

You can also look herefor format options for all calendar views.

您还可以在此处查看所有日历视图的格式选项。

回答by Ben

For those who are using the FullCalendar v3
It seems that the configuration has changed.

对于那些使用 FullCalendar v3 的人来说
,似乎配置发生了变化。

You can use the columnHeader Format, Text, or Html properties
As explained in this very nice documentation:
https://fullcalendar.io/docs/date-display

您可以使用 columnHeader 格式、文本或 Html 属性
如这个非常好的文档中所述:https:
//fullcalendar.io/docs/date-display

And apply them to different views following this one:
https://fullcalendar.io/docs/view-specific-options

并将它们应用于以下不同的视图:https:
//fullcalendar.io/docs/view-specific-options