bug-fix: 修复自定义format包含数字提示格式错误的问题

pull/70/head
LanFly 2018-03-28 17:42:46 +08:00
parent bfc0c1bf6d
commit c4c6d81a39
1 changed files with 2 additions and 1 deletions

View File

@ -435,6 +435,7 @@
var that = this
,options = that.config
,dateType = 'yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s'
,safeType = '\\w'
,isStatic = options.position === 'static'
,format = {
year: 'yyyy'
@ -474,7 +475,7 @@
if(/^y$/.test(item)) return '1,308';
return '1,2';
}() +'}'
: '\\' + item;
: new RegExp(safeType).test(item) ? '' + item : '\\' + item;
that.EXP_IF = that.EXP_IF + EXP;
that.EXP_SPLIT = that.EXP_SPLIT + '(' + EXP + ')';
});