dateFormat fix
This commit is contained in:
1 parent
0b230a26b4
commit
9fb6eaab66
1 file changed
+2
-1
+2
-1
@@ -8,7 +8,8 @@ import { ru } from 'date-fns/locale'
|
|||||||
* @param date
|
* @param date
|
||||||
*/
|
*/
|
||||||
export const dateFormat = (date: string | Date) => {
|
export const dateFormat = (date: string | Date) => {
|
||||||
return format(new Date(2014, 6, 2), "d MMMM yyyy", {
|
const value = typeof date === 'string' ? new Date(date) : date
|
||||||
|
return format(value, "d MMMM yyyy", {
|
||||||
locale: ru
|
locale: ru
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user