jsDatePick - 使用选定日期 [英] jsDatePick - Using a Selected Date

查看:87
本文介绍了jsDatePick - 使用选定日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用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 * /
});

如果我然后取消对所选日期部分的评论,我会在日历上加上或者它无法加载语法问题



有人可以帮忙吗?



谢谢

解决方案

我遇到了同样的问题,并从这位德国人的帖子中找到了以下解决方案( 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条件和操作。 / p>

在你的HTML中,你需要使用jsDatePick.full.1.3.js。



希望这有助于。


Using the jsDatePick Full JQuery example i am unable to get the calender to load with a specified date selected, i recieve either undifined message or syntax errors

The full code can be downloaded from JsDatePick

The Code they supply

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*/
});

If i then un comment the slected date part i get either undifined on the calendar once it loads or it fails to load with a syntax issue

Can anyone help?

Thanks

解决方案

I had the same problem and found the following solution from a post by this German fellow (http://www.viathinksoft.de/?page=news&id=184). The post is in German and if you translate it in English, it messes up the code he provided so copy the code first or you can copy below. Here's his fix, you need to modify "jsDatePick.full.1.3.js" script, function "setConfiguration" with the following:

 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;                                   
 }

Basically, he added the "else" condition and actions to the code.

In your HTML, you need to use "jsDatePick.full.1.3.js".

Hope this helps.

这篇关于jsDatePick - 使用选定日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆