laydate使用
//选择时分秒
$(".laydate-time").each(function(){
var _this = this;
laydate.render({
elem: this,
format: 'HH:mm', //过滤只显示时分
type: 'time', //time类型只有时分秒
ready: function(date){
$(_this).val(DateJsonFormat(date,this.format)); //初次点击时自动显示当前时间
}
});
});
//选择年月日时分秒
$(".laydate-datetime").each(function(){
var _this = this;
laydate.render({
elem: this,
format: 'yyyy-MM-dd HH:mm', //过滤只显示年月日时分
type: 'datetime',
ready: function(date){
$(_this).val(DateJsonFormat(date,this.format));
}
});
});
//选择年月日(不填写过滤,默认年月日)
$(".laydate-date").each(function(){
var _this = this;
laydate.render({
elem: this,
ready: function(date){
$(_this).val(DateJsonFormat(date,this.format));
}
});
});
