layui.laydate默认当前时间时分秒,详细代码如下:layui.laydate默认当前时间时分秒,详细代码如下: //加载日期控件信息 layui.use('laydate', function() { var laydate = layui.laydate; var now = new Date(); laydate.render({ elem: '#publishTime', theme: 'molv', type: 'datetime', trigger: 'click', max:4073558400000, //公元3000年1月1日 ready
//加载日期控件信息
layui.use('laydate', function() {
var laydate = layui.laydate;
var now = new Date();
laydate.render({
elem: '#publishTime',
theme: 'molv',
type: 'datetime',
trigger: 'click',
max:4073558400000, //公元3000年1月1日
ready: function(date){
//console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
this.dateTime.hours=now.getHours();
this.dateTime.minutes=now.getMinutes();
this.dateTime.seconds=now.getSeconds();
}
/*done: function(value, date, endDate){
var createTime = $("#createTime").val();
var start = new Date(createTime);
var end = new Date(value);
if(start.getTime() > end.getTime()){
$.modal.msgError("回复的发布时间不能早于被回复的发布时间!");
return;
}
}*/
});
});
织梦狗教程
本文标题为:layui.laydate默认选择当前时间时分秒的代码


基础教程推荐
猜你喜欢
- D3.js SVG线示例 1970-01-01
- Bootstrap <abbr>元素的文本 1970-01-01
- Bootstrap淡化效果 1970-01-01
- Bootstrap选项卡式菜单 1970-01-01
- Bootstrap显示和隐藏内容 1970-01-01
- Bootstrap排版Blockquotes 1970-01-01
- Bootstrap备用进度条 1970-01-01
- Bootstrap快速浮动 1970-01-01
- D3.js selectAll()用法 2022-07-13
- Bootstrap小输入字段 1970-01-01