This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description 将时间转换成指定格式 | |
* @param {String|Number} time | |
* @param {String} fmt | |
*/ | |
export function timesToDate(time, fmt) { | |
fmt = fmt || 'yyyy-MM-dd'; | |
time = anyTotime(time); | |
let date = new Date(time); | |
if (/(y+)/.test(fmt)) { |