mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-10 19:32:28 +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) {
|
||||
if (!date) {
|
||||
return ''
|
||||
}
|
||||
try {
|
||||
return fecha.format(new Date(date), format)
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user