diff --git a/examples/util.html b/examples/util.html index b4e9f1fa..96fc5f4b 100644 --- a/examples/util.html +++ b/examples/util.html @@ -29,6 +29,14 @@ body{padding: 50px;}
+请编辑格式: +
+ +
+ + +
+
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
@@ -121,6 +129,17 @@ layui.use(['util', 'layer'], function(){ alert(othis.html()) } }); + + // 转换日期格式 + var timer = null + if (timer) clearInterval(timer) + var toDateString = function (format) { + var dateString = util.toDateString(new Date(), format) // 执行转换日期格式的方法 + $('#test3').html(dateString) + } + timer = setInterval(() => { + toDateString($('#test2').val()) + }, 50) });