而不是使用完整日历插件,我设法使用JavaScript和jQuery来显示我的事件数据到日历(我创建了自己的帖子类型,因为我不知道如何使用WP-Calendar插件)。它工作得很好,其他选项工作得很好,除了lang option!
由于FullCalendar以英语显示,所以我想将其配置为韩语,因此我这样做:
jQuery(document).ready(function(){
jQuery('#calendar').fullCalendar({
theme: true,
lang: 'ko',
header: {
left: 'prev, next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: themeforce.events
});
});
它在单独的PHP(不是每个主题的functions.php
)中工作得很好,但现在在WordPress中它没有。有人知道为什么这会导致问题吗?
插件网址:https://wordpress.org/plugins/wp-calendar/
我在fullcalendar.js
中没有发现任何 lang
参数。但是这些选项可以满足你的需要:
// time formats
titleFormat: {
month: 'MMMM yyyy',
week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}",
day: 'dddd, MMM d, yyyy'
},
columnFormat: {
month: 'ddd',
week: 'ddd M/d',
day: 'dddd M/d'
},
timeFormat: { // for event elements
'': 'h(:mm)t' // default
},
// locale
isRTL: false,
firstDay: 0,
monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
buttonText: {
prev: ' ◄ ',
next: ' ► ',
prevYear: ' << ',
nextYear: ' >> ',
today: 'today',
month: 'month',
week: 'week',
day: 'day'
},