0

I want to ask if they is any way to edit my input type date so it shows only dd-mm-rrrr, I'm making Book managment system which connects with Postgresql API and if I make an input like this:

 <Form.Group controlId="releaseDate">
                    <Form.Control className="control-input" type="date" name="release_date" defaultValue={props.release_date} placeholder="Write the release date of the book" onChange={handleInputChange} />
                </Form.Group>

the result is something like this: 2021-04-29T22:00:00.000Z

Is there any way to change it or is a problem of API, the database that converts it to something like this?

handleInputChange

 const handleInputChange = (e) => {
        const name = e.target.name
        const value = e.target.value

        setBook((prev) => ({...prev, [name]: value}));
    }
sunny
  • 65
  • 1
  • 8

0 Answers0