Javascript 如何使用Drupal 7在Fullcalendar中获取24小时日期格式
我知道官方文件的选项 除了Javascript 如何使用Drupal 7在Fullcalendar中获取24小时日期格式,javascript,drupal,fullcalendar,Javascript,Drupal,Fullcalendar,我知道官方文件的选项 除了timeFormat和axisFormat之外的所有其他选项都工作得很好,但是我的timeFormat始终显示为am/pm,我需要24小时格式 /** * @file * Processes the FullCalendar options and passes them to the integration. */ (function ($) { Drupal.fullcalendar.plugins.fullcalendar =
timeFormat
和axisFormat
之外的所有其他选项都工作得很好,但是我的timeFormat
始终显示为am/pm,我需要24小时格式
/**
* @file
* Processes the FullCalendar options and passes them to the integration.
*/
(function ($) {
Drupal.fullcalendar.plugins.fullcalendar = {
options: function (fullcalendar) {
var settings = Drupal.settings.fullcalendar[fullcalendar.dom_id];
var options = {
dragOpacity: 0.5, /* This option IS working*/
timeFormat: { '': 'H:mm' }, /* This is NOT working */
axisFormat: { '': 'H:mm' },
columnFormat: {
month: 'ddd', // Mon
week: 'ddd d/M', // Mon 9/7
day: 'dddd d/M' // Monday 9/7
},
...
我使用的是Drupal 7,该模块嵌入了Fullcalendar库(版本1.5.1),按照24小时格式用HH
表示。尝试将代码更改为:
(function ($) {
Drupal.fullcalendar.plugins.fullcalendar = {
options: function (fullcalendar) {
var settings = Drupal.settings.fullcalendar[fullcalendar.dom_id];
var options = {
dragOpacity: 0.5, /* This option IS working*/
timeFormat: { '': 'HH:mm' }, /* This is NOT working */
axisFormat: { '': 'HH:mm' },
columnFormat: {
month: 'ddd', // Mon
week: 'ddd d/M', // Mon 9/7
day: 'dddd d/M' // Monday 9/7
},
...
如果您使用的是Drupal 7模块,那么您可以在视图的配置中设置时间格式 编辑“格式”部分中的视图并检查设置。在时间/日期设置字段集中,您可以更改格式 默认值为h:mm{-h:mm}。将其更改为HH:mm{-HH:mm}作为24小时时间表示法