Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/425.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用Drupal 7在Fullcalendar中获取24小时日期格式_Javascript_Drupal_Fullcalendar - Fatal编程技术网

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小时时间表示法