JeeCG中如何设置My97DatePicker只显示月份
BY ARCKO · 2014/11/06来自:http://memleak.in/2014/11/06/jeecg-my97datepicker-month-only/
JeeCG3.4.3框架中日历控件用的是My97DatePicker,js文件在jeecg-framework\src\main\webapp\plug-in\My97DatePicker\WdatePicker.js 内容截取如下:
/* * My97 DatePicker 4.8 Beta2 * License: http://www.my97.net/dp/license.asp */ var $dp,WdatePicker;(function(){var $={ $langList:[{name:"en",charset:"UTF-8"},{name:"zh-cn",charset:"UTF-8"},{name:"zh-tw",charset:"UTF-8"}], $skinList:[ {name:"default",charset:"gb2312"}, {name:"whyGreen",charset:"gb2312"}, {name:"blue",charset:"gb2312"}, {name:"green",charset:"gb2312"}, {name:"ext",charset:"gb2312"}, {name:"blueFresh",charset:"gb2312"} ], $wdate:true, $crossFrame:true, $preLoad:false, doubleCalendar:false, enableKeyboard:true, enableInputMask:true, autoUpdateOnChanged:null, weekMethod:”ISO8601″, position:{}, lang:”auto”, skin:”default”, dateFmt:”yyyy-MM-dd”, realDateFmt:”yyyy-MM-dd”, realTimeFmt:”HH:mm:ss”, realFullFmt:”%Date %Time”, minDate:”1900-01-01 00:00:00″, maxDate:”2099-12-31 23:59:59″, startDate:””, alwaysUseStartDate:false, yearOffset:1911, firstDayOfWeek:0, isShowWeek:false, highLineWeekDay:true, isShowClear:true, isShowToday:true, isShowOK:true, isShowOthers:true, readOnly:false, errDealMode:0, autoPickDate:null, qsEnabled:true, autoShowQS:false, …
看得出其中可以设置的选项开关还是挺多的。 这里根据需求只是想选择月份,不需要精确到具体哪一天。网上搜索说调用的时候只需要设置dateFmt成yyyy-MM即可。
在JEECG代码中,具体用到的地方比如jeecg-framework\src\main\java\org\jeecgframework\web\cgreport\engine\core\cgreportlistwater.ftl:
onclick=”WdatePicker({ dateFmt: ‘yyyy-MM’, isShowToday: false, isShowClear: false });” /> 效果如下: 参考:http://blog.csdn.net/ranbolwb/article/details/7323562
页:
[1]