fix[parseTime]: fixed when pass null (#3038)

This commit is contained in:
cooper
2020-05-05 13:21:51 +08:00
committed by 花裤衩
parent b8c934c81a
commit 2ed1951355
2 changed files with 6 additions and 1 deletions

View File

@@ -9,7 +9,7 @@
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'