增加日期控件显示类型及回显格式扩展选项

dep_wangsr
RuoYi 6 years ago committed by Limy
parent e63ee3f7a1
commit 64f20dbc6e

@ -72,12 +72,18 @@ $(function() {
layui.use('laydate', function() { layui.use('laydate', function() {
var laydate = layui.laydate; var laydate = layui.laydate;
var times = $(".time-input"); var times = $(".time-input");
// 控制控件外观
var type = times.attr("data-type") || 'date';
// 控制回显格式
var format = times.attr("data-format") || 'yyyy-MM-dd';
for (var i = 0; i < times.length; i++) { for (var i = 0; i < times.length; i++) {
var time = times[i]; var time = times[i];
laydate.render({ laydate.render({
elem: time, elem: time,
theme: 'molv', theme: 'molv',
trigger: 'click', trigger: 'click',
type: type,
format: format,
done: function(value, date) {} done: function(value, date) {}
}); });
} }

Loading…
Cancel
Save