2012-03-01 20 views
0

私は公式文書のオプションを知っています。Drupal 7でFullcalendarで24時間の日付形式を取得する方法

timeFormatおよびaxisFormat以外のすべてのオプションは正常に機能しますが、timeFormatは24時間形式が必要な場合は常にam/pmとして表示されます。

/** 
* @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 
       }, 
... 

Iは、24時間形式をHHで示されdocumentation for timeFormatによればFullcalendarライブラリを埋め込むのDrupal 7、モジュール(バージョン1.5.1)

答えて

0

を使用しています。これにあなたのコードを変更してみてください:

(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 
    }, 
... 
2

あなたがDrupalの7モジュールFullcalendarを使用している場合、あなたはビューの設定で時刻の形式を設定することができます。

編集ビューと設定フォーマットセクションでをご確認ください。イン時刻/日付設定フィールドセットを変更することができます。

デフォルトはh:mm { - h:mm}です。これをHH:mm { - HH:mm}に変更して、24時間表記にします。 enter image description here

関連する問題