score:0
okay, i solved this by setting my date in state as date object instead of string.
setridedetails({
startlocation: ridedetails.startfrom,
endlocation: ridedetails.endin,
startdateandtime: ridedetails.starttime,
car: ridedetails.car.id,
availableseats: ridedetails.numberofseats,
price: ridedetails.price,
});
--->
setridedetails({
startlocation: ridedetails.startfrom,
endlocation: ridedetails.endin,
startdateandtime: new date(ridedetails.starttime),
car: ridedetails.car.id,
availableseats: ridedetails.numberofseats,
price: ridedetails.price,
});
Source: stackoverflow.com
Related Query
- How to correctly set initial state in React with Typescript without constructor?
- How do you update Formik initial values with the react context api values after an AJAX request?
- How to Set Initial Values to Formik using Axios with Typescript
- How to set initial date in react-datepicker with Formik?
- How to set initial state in top level react component with redux?
- How to set initial state with most up to date data returned from API?
- How to set up Babel 6 stage 0 with React and Webpack
- How to pass state values to initial values in formik in react js
- How can I set initial React state from API data?
- How to set srcObject on audio element with React
- How to set initial state with using ES6 class in React?
- How to restrict date selection in React native ios/android datepicker
- How to receive select value in handlesubmit function with formik react js?
- Clear Formik field with initial value React
- How to set cookie in React Native with Expo?
- How to get values from react FieldArray in formik form with other fields?
- How to set route with optional query parameter using React router?
- react | redux-form | material-ui | how to combine DatePicker with my form
- How to set initial tab in react navigation TabNavigator dynamically
- How to show an alert with errors found after submitting Formik form in react native
- How to select time with React DatePicker
- REACT - Set initial data in Formik Form after fetching from API
- React Datepicker How to format date from string
- How to correctly set up React Router with multilanguage/multiple index.html files?
- Render a div in React with an initial scrollTop value set
- How to set a Modal popup with an image in React
- How do I load inital set of data with ajax call in React redux?
- how to set focus to next input on enter key press in react js with refs
- React Formik : How to useEffect with formik values?
- React datepicker set min and max date
More Query from same tag
- Show Sidebar Navigation only at Home using React-Router-Dom V6
- React - Keeping user on same page - prevent page refresh
- Scrolling without moving main content
- This state.....filter is not an option? React Reducers
- How to avoid re-rendering of child components whenever parent's state is updated
- How to pass only the date to the database (without passing the time) using react-datetime picker
- using multiple redux stores one for each app user
- DeckGL & Mapbox: How access ref element on map movement?
- How to redirect to log in page after click logout button on navbar header in React?
- React Material UI : 'theme' is not defined no-undef
- Firebase Admin Failed to determine project ID
- useState Hook not working inside event listener
- Make undo button in recoil js
- Call multiple async functions using useEffect
- setting this.state in react leaf component when using redux, anti-pattern? benefits / disadvantages
- How do I show a specific web design to a user?
- MUI TextField: How to prevent form from being submitted?
- Authorization and Authentication using react - router - dom
- How to get state via React-Loadable? React-Redux
- using postMessage in a modal to communicate the parent window
- How to redirect user to url "/home" after some request is complete using react and typescript?
- updating array in object properties using properties
- Express server stops after 5 GET requests
- Update defaultValue on React component after successful request
- map function not working in React
- Storing methods needed in all components
- How do I deploy a simple React app as a "user page" to Github Pages?
- ReactJS Router component not displaying anything
- ReactJS. Firebase. TypeError: Cannot read property 'setState' of undefined
- How to render components in a nested route