Commit 5856c93035143dd42cb93abb4753a98061c54d49
1 parent
f749b9db
v3.7.0 修复带utc日期格式 yyyy-MM-dd'T'HH
ss.SSS 在safari浏览器中无法正确格式化的问题
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-ui-admin/src/utils/ruoyi.js
| @@ -18,7 +18,7 @@ export function parseTime(time, pattern) { | @@ -18,7 +18,7 @@ export function parseTime(time, pattern) { | ||
| 18 | if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | 18 | if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { |
| 19 | time = parseInt(time) | 19 | time = parseInt(time) |
| 20 | } else if (typeof time === 'string') { | 20 | } else if (typeof time === 'string') { |
| 21 | - time = time.replace(new RegExp(/-/gm), '/'); | 21 | + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm),''); |
| 22 | } | 22 | } |
| 23 | if ((typeof time === 'number') && (time.toString().length === 10)) { | 23 | if ((typeof time === 'number') && (time.toString().length === 10)) { |
| 24 | time = time * 1000 | 24 | time = time * 1000 |