SysPlanShowScript.js 964 B

12345678910111213141516171819202122232425262728293031323334
  1. //初始化跳转事件和有指定的视图日期
  2. function initGoToTheDate(){
  3. //初始化跳转事件
  4. $("#goToTheDate").click(function() {
  5. goToTheDate();
  6. });
  7. //初始化指定的视图日期
  8. var currentViweDate = $("input[name='theDate']").val();
  9. if(typeof(currentViweDate)=='undefined'||currentViweDate==null||currentViweDate==''){
  10. return;
  11. }
  12. goToTheDate();
  13. $("input[name='theDate']").val("");
  14. }
  15. //初始化跳转事件
  16. function goToTheDate(){
  17. if(!calendarObj){
  18. return;
  19. }
  20. var theDate = $("input[name='theDate']").val();
  21. if(typeof(theDate)=='undefined'||theDate==null||theDate==''){
  22. $.ligerDialog.warn("请选择跳转日期!","消息提示");
  23. return;
  24. }
  25. var arryDay = theDate.split("-"); //字符分割
  26. //这种方式才可以正常设置成时间:new Date(year, month, day, hour, miniute, second) 月份要减少1
  27. var date = new Date(arryDay[0],arryDay[1]-1,arryDay[2],0,0,0);
  28. calendarObj.goToTheDate(date);
  29. }