Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many .date methods return "any" type #329

Open
moltar opened this issue Apr 8, 2020 · 1 comment
Open

many .date methods return "any" type #329

moltar opened this issue Apr 8, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@moltar
Copy link

moltar commented Apr 8, 2020

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: returns any
  • dateFns.date: returns Date

I also checked moment and it also returns any.

@dmtrKovalenko
Copy link
Owner

Hmm, yeah it looks like a problem.
Would you like to investigate it and open an a PR?

@dmtrKovalenko dmtrKovalenko added the enhancement New feature or request label Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants