0

jsDatePick Full JQueryの例を使用すると、指定した日付を選択した状態でカレンダーをロードできません。未定義のメッセージまたは構文エラーのいずれかを受け取ります。

完全なコードはJsDatePickからダウンロードできます

彼らが提供するコード

g_globalObject2 = new JsDatePick({
useMode:1,
isStripped:false,
target:"div4_example",
cellColorScheme:"beige"
/*          
selectedDate:{
day:16,
month:3,
year:2013
},
yearsRange:[1978,2020],
limitToToday:false,
dateFormat:"%m-%d-%Y",
imgPath:"img/",
weekStartDay:1*/
});

次に、選択した日付部分のコメントを解除すると、カレンダーが読み込まれるとカレンダーで未定義になるか、構文の問題で読み込みに失敗します

誰か助けてもらえますか?

ありがとう

4

3 に答える 3

1

私は同じ問題を抱えていて、このドイツ人フェロー ( http://www.viathinksoft.de/?page=news&id=184 ) の投稿から次の解決策を見つけました。投稿はドイツ語であり、英語に翻訳すると、彼が提供したコードが台無しになるため、最初にコードをコピーするか、以下をコピーできます. これが彼の修正です。「jsDatePick.full.1.3.js」スクリプト、関数「setConfiguration」を次のように変更する必要があります。

 this.selectedDayObject = {};
 this.flag_DayMarkedBeforeRepopulation = false;
 this.flag_aDayWasSelected = false;
 this.lastMarkedDayObject = null;

 if (!this.oConfiguration.selectedDate){
      this.currentYear      = this.oCurrentDay.year;
      this.currentMonth     = this.oCurrentDay.month;
      this.currentDay          = this.oCurrentDay.day;
 } else {
      this.currentYear      = this.oConfiguration.selectedDate.year;
      this.currentMonth     = this.oConfiguration.selectedDate.month;
      this.currentDay          = this.oConfiguration.selectedDate.day;
      this.selectedDayObject = this.oConfiguration.selectedDate;
      this.flag_aDayWasSelected = true;                                   
 }

基本的に、彼は「else」条件とアクションをコードに追加しました。

HTML では、「jsDatePick.full.1.3.js」を使用する必要があります。

お役に立てれば。

于 2013-05-15T17:14:16.270 に答える
0

選択した日付部分のコメントを外すとき,、 の最後にを追加しましたcellColorScheme:"beige"か? そうでない場合は、構文エラーが発生します。

于 2013-03-15T17:09:50.130 に答える
0

私は同じ問題を抱えていて、編集ページにあったので、編集中のレコードをjsDatePick日付で設定し、それをターゲットテキストボックスに表示する必要があります(テキストボックスに日付を設定するだけではできませんでした。そもそも NaN の問題)。したがって、私の決議はセザールの決議の延長です。

this.selectedDayObject = {};  
this.flag_DayMarkedBeforeRepopulation = false;  
this.flag_aDayWasSelected = false;  
this.lastMarkedDayObject = null;


 if (!this.oConfiguration.selectedDate){
      this.currentYear      = this.oCurrentDay.year;
      this.currentMonth     = this.oCurrentDay.month;
      this.currentDay          = this.oCurrentDay.day;  } else {
      this.currentYear      = this.oConfiguration.selectedDate.year;
      this.currentMonth     = this.oConfiguration.selectedDate.month;
      this.currentDay          = this.oConfiguration.selectedDate.day;
      this.selectedDayObject = this.oConfiguration.selectedDate;
      this.flag_aDayWasSelected = true; 
      this.populateFieldWithSelectedDate();
}

これにより、closeCalendar 関数で問題が発生するため、次のように変更する必要があります。

JsDatePick.prototype.closeCalendar = function () {
    if (this.JsDatePickBox) {
        this.JsDatePickBox.style.display = "none";
        document.onclick = function() {};
    }
};
于 2016-04-12T17:42:03.787 に答える