From a0161b4e6cb7ed6342d41e0a88cbf7497d641b89 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Sat, 5 Aug 2023 20:00:43 +0800 Subject: [PATCH] update code --- src/modules/util.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/util.js b/src/modules/util.js index 2a0197aa..1581de74 100644 --- a/src/modules/util.js +++ b/src/modules/util.js @@ -255,9 +255,11 @@ layui.define('jquery', function(exports){ // 转化为日期格式字符 toDateString: function(time, format){ - //若 null 或空字符,则返回空字符 + // 若 null 或空字符,则返回空字符 if(time === null || time === '') return ''; - + + // 引用自 dayjs + // https://github.com/iamkun/dayjs/blob/v1.11.9/src/constant.js#L30 var REGEX_FORMAT = /\[([^\]]+)]|y{1,4}|M{1,2}|d{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|SSS/g; var that = this; var date = new Date(function(){