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

date doesn't return the value. it returns empty object #3

Open
mahtabfalahat opened this issue Jul 3, 2022 · 2 comments
Open

date doesn't return the value. it returns empty object #3

mahtabfalahat opened this issue Jul 3, 2022 · 2 comments

Comments

@mahtabfalahat
Copy link

hi, i'm using the package date picker
in , when i want to set the date value on state on onChange, it won't set and i just get an empty object :
Object { }

how can i get the date value ?
thanks ..

@AliBayatMokhtari
Copy link

Can you provide a code sand box link?

@dragongling
Copy link

I had this problem too, found the following workaround for extracting month:

function onMonthChange(date: DateObject | DateObject[] | null,
                         options: any) {
    if(date){
      const formattedMonth = `${date.year}-${date.month.number}`
      console.log(formattedMonth)
    }
  }

Even if it shows empty in browser console you can still extract properties like year, month, day, hour, minute and etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants