diff --git a/lib/formatDate.js b/lib/formatDate.js index 5674b170..6f274da8 100644 --- a/lib/formatDate.js +++ b/lib/formatDate.js @@ -5,7 +5,7 @@ * @returns {string} */ export default function formatDate (date, local) { - if (!date) return '' + if (!date || !local) return date || '' const d = new Date(date) const options = { year: 'numeric', month: 'short', day: 'numeric' } const res = d.toLocaleDateString(local, options)