date-io
date-io copied to clipboard
many .date methods return "any" type
From your example:
import LuxonAdapter from '@date-io/luxon'
import DateFnsAdapter from '@date-io/date-fns'
const dateFns = new DateFnsAdapter()
const luxon = new LuxonAdapter({ locale: 'fr' }) // pass french locale
const initialLuxonDate = luxon.date('2018-10-28T11:44:00.000Z')
const initialDateFnsDate = dateFns.date('2018-10-28T11:44:00.000Z')
const updatedLuxonDate = luxon.addDays(initialLuxonDate, 2)
const updatedDateFnsDate = dateFns.addDays(initialDateFnsDate, 2)
luxon.format(updatedLuxonDate, 'fullDateTime24h') // "2018, octobre 30 11:44"
dateFns.format(updatedLuxonDate, 'fullDateTime24h') // "2018, October 30th 11:44"
-
luxon.date: returnsany -
dateFns.date: returnsDate
I also checked moment and it also returns any.
Hmm, yeah it looks like a problem. Would you like to investigate it and open an a PR?