2017-01-25 15 views
1

私はデータベースにいくつかの日付を含むテーブルを持っています。私はそれらの日付をmagentoのデフォルトのカレンダーで無効にしたい。カレンダーは、フロントエンドのチェックアウトプロセス(注文の配送日を追加するために使用されます)にあります。どんな提案も感謝します。日付期間を有効にするJavaスクリプトのデフォルトのカレンダー

Calendar.setup({ 
    inputField : "date",     // ID of the input field 
    ifFormat : "<%=systemDateFormat%>", // the date format 
    button  : "triggerDate" ,   // ID of the button 
    disableFunc: ??????, 
}); 

<style type="text/css">@import url(calendar-system.css);</style> 
<script type="text/javascript" src="calendar.js"></script> 
<script type="text/javascript" src="lang/calendar-en.js"></script> 
<script type="text/javascript" src="calendar-setup.js"></script> 

答えて

1

日付を次の方法で無効にすることができます。

function disabledDate(date) { 
      //get all dates from Server in Array 
      var disabledDates = []; // add all dates with (,) separated here. 
      for(i=0; i <disabledDates.length;i++) 
      { 
       // Parse the date one by one and match with 
      if(date.getDate() == PARSED_DATE) 
      return true;      
      } 
      return false; 


     }; 

そして、あなたはあなたのセットアップでこの機能を追加することができます

Calendar.setup({ 
    inputField : "date",     // ID of the input field 
    ifFormat : "<%=systemDateFormat%>", // the date format 
    button  : "triggerDate" ,   // ID of the button 
    disableFunc: disabledDate 
}); 
関連する問題