Comments (6)
Hello
Most likely your date is undefined
or null
here
react-datepicker/src/date_utils.ts
Line 1409 in 27829c7
from react-datepicker.
Thank a lot for reply!
I looked that this function gets selected prop to work with. I understand that it can drop an error because of providing timestamp value to component. But i tried to provide hardcoded timestamp value to similar components on screenshots with the similar other props and here we have two different results. First picture made in project where component drops an error just by clicking the input with hardcoded value, in the second case we can normally operate with the datepicker without errors (of course we have hardcoded value too, but we have controller value changing). So it looks weird for me now why we have different result using the same value for selected prop. On the third picture is the example of calendar working in the second project. But if i just clicking on prefilled input on the last screenshot - it crashes :(
from react-datepicker.
try to isolate the selected
prop from the rest of the optional props because one of them may affect business logic.
also, try to reproduce the problem on the latest version of the library -- 6.9.0
from react-datepicker.
I'm sorry, i forgot to write that update to 6.9.0 version didn't solve the problem. I played with props, only prop showTimeSelect affects on error. I used calendar in the second project without time selection, but i added it to check how would it work and it works ok. In the first project i have no error without showTImeSelect property.
from react-datepicker.
I have more concerns about {...rest} spread
the library will be converted to TS soon #4700 so it might help with debugging your problem
from react-datepicker.
Rest is just empty object, i tried to remove influence of unnecessary props on component.
from react-datepicker.
Related Issues (20)
- Error when installing dependencies
- Gap between arrow and the datepicker HOT 1
- Datepicker onChange event type Error when selectsRange prop is true HOT 1
- SelectsMultiple with DateTime or TimeOnly
- Click outside day of month then React DatePicker auto close, can't not select end date?
- Accessibility: Navigation options within react-datepicker not adequately relayed to screen reader
- Accessibility: Button Contrast
- Can't import the named export 'startOfWeek' from non EcmaScript module (only default export is available)
- onclickoutside not working with react 19 in datepicker
- TypeError after upgrading to 5.0.0
- Is the calendar accessible to screen readers? HOT 1
- custom month content on dropdown
- Support ref.focus() alias
- Is there any way to make the datepicker be always open ? HOT 1
- Input parser is not working correctly for dates HOT 2
- Input blur after date select HOT 1
- Able to focus on disabled months. HOT 1
- Wrong year is shown in year select if past date is selected with minDate={new Date()}
- Keyboard navigation not working as expected when includeDates is set.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-datepicker.