canner 日历数据插件
jsp引用: <link rel="stylesheet" id="homePageCss" href="<top:webRoot/>/iems/page/homePage/canner/calendar.css" /> [removed]/iems/page/homePage/canner/Math.uuid.js">[removed] [removed]/iems/page/homePage/canner/calendar.js">[removed] [removed]/iems/page/homePage/canner/DateUtils.js">[removed] <div id="eleCalendar" class="body_content4_calendar"></div> //js方法 var time = new Date(queryVO.searchTime.replace("-g-/", "")).Format("yyyyMM"); initProjectList(dataArrayObj,time); function initProjectList(data,time){ for(var i=0; i <data.length;i++ ){ var row= data[i]; if(row.dayTime){ console.log(row.dayTime); var dateTime= row.dayTime; if(dateTime instanceof Date){ continue; }else{ row.dayTime = new Date(Date.parse(dateTime.replace(/-/g, "/"))); } console.log(row.dayTime); } } if(time ==undefined || time == null ){ time = new Date().Format("yyyyMM"); } var calendar = $("#eleCalendar").calendar({ month : time, animate : false }); // 日历数据 var calendar_data = { }; var status = { "1" : { class : "normal", html : "正常" }, "2" : { class : "abnormal", html : "超支" } } $(data).each(function(i, item) { var dataObj = item; var dateTimeName = item.dayTime.Format("yyyyMMdd"); var iStatus = item.state; var $status = { class : "good", html : "正常" }; if (status[iStatus]) { $status = status[iStatus]; } calendar_data[dateTimeName] = { dateTimeName:dateTimeName, class : $status.class, DATATIME : item.dayTime.Format("yyyy-MM-dd"), html : item.dayEleData, dayData:item.dayEleData }; }); // 装载数据 var calendar_limit = 0; console.log(calendar_data); calendar.loadData(calendar_data, calendar_limit, function(time,item) { searchExpData(item.DATATIME,item.IS_READ); }); } var dataArrayObj = [{dayTime:"2018-03-01" ,dayEleData:353.5,state:1}, {dayTime:"2018-03-02" ,dayEleData:200,state:1}, {dayTime:"2018-03-03" ,dayEleData:353.5,state:2}, {dayTime:"2018-03-04" ,dayEleData:353.5,state:1}, {dayTime:"2018-03-05" ,dayEleData:353.5,state:1}, {dayTime:"2018-03-06" ,dayEleData:353.5,state:1}, {dayTime:"2018-03-07" ,dayEleData:50.5,state:1}, {dayTime:"2018-03-08" ,dayEleData:353.5,state:1}, {dayTime:"2018-03-09" ,dayEleData:150.5,state:1}, {dayTime:"2018-03-10" ,dayEleData:354,state:2}, {dayTime:"2018-03-11" ,dayEleData:222,state:1}, {dayTime:"2018-03-12" ,dayEleData:584,state:2}, {dayTime:"2018-03-13" ,dayEleData:574,state:2}, {dayTime:"2018-03-14" ,dayEleData:222,state:1}, {dayTime:"2018-03-15" ,dayEleData:245.1,state:1} ]
- 1
- 粉丝: 0
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助