mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-24 08:50:36 +03:00
fix: stringify function returns a error value,when date is null (#244)
This commit is contained in:
@@ -55,6 +55,9 @@ export function formatTime (time, type = '24', a = 'a') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function formatDate (date, format) {
|
export function formatDate (date, format) {
|
||||||
|
if (!date) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return fecha.format(new Date(date), format)
|
return fecha.format(new Date(date), format)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user