Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
React datepicker return 'null' and invalid data

I'm trying to write a simple todo App and The problem is that i got 'invalid data' in the datepicker input and datepicker return 'null' in object. I guess, the main issue in the datepicker, but don't know what exactly should i look for.


    const [addTodo] = useMutation(ADD_TODO)
    const onSubmit = e => {
        e.preventDefault();
        addTodo({
            variables:{
                title:todo.title,
                detail:todo.detail,
                date:todo.date,
            }, refetchQueries: [
                { query: GET_TODOS }
            ]
        })
    }

            <DatePicker
                onSubmit={onSubmit}
                id="date"
                value={moment(todo.date)}
                onChange={e => setTodo ({...todo, date: e.target.value})}
                dateFormat="dd MM yyyy"
                className={'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}
                showDisabledMonthNavigation
            />

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!