Giter VIP home page Giter VIP logo

Comments (6)

mirus-ua avatar mirus-ua commented on June 2, 2024

Hello
Most likely your date is undefined or null here

const startOfDay = new Date(d.getFullYear(), d.getMonth(), d.getDate());

from react-datepicker.

UnknownVladyslav avatar UnknownVladyslav commented on June 2, 2024

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 :(

image
image
image
image

from react-datepicker.

mirus-ua avatar mirus-ua commented on June 2, 2024

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.

UnknownVladyslav avatar UnknownVladyslav commented on June 2, 2024

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.

mirus-ua avatar mirus-ua commented on June 2, 2024

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.

UnknownVladyslav avatar UnknownVladyslav commented on June 2, 2024

Rest is just empty object, i tried to remove influence of unnecessary props on component.
image

from react-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.