I am using SingleDatePicker and wish to set the initial date. I have noticed that the date prop is required to be a moment instance. The project I am working on is using another Date library meaning that right now I have to add an entire library just to set the initial date in the picker.
Can we have the option to use at least an ISO string instead?
Happy to submit a PR for this.
The entirety of react-dates needs moment, so you do in fact need to add the entire library regardless.
The entirety of react-dates needs moment, so you do in fact need to add the entire library regardless.
Right, but I think this poses an unnecessary restriction. Would it be possible to expose a formatter API or perhaps allow the startDate and endDate props to accept something a bit more neutral like an ISO string as @LewisYearsley suggested, and then internally, react-dates would make the conversion to a moment Object?
We depend on moment for locale information as well; react-dates can't be used without moment.
When the Temporal proposal lands in the language, we'll switch to use that.
We depend on moment for locale information as well; react-dates can't be used without moment.
When the Temporal proposal lands in the language, we'll switch to use that.
Thanks for responding! I completely understand the dependency for moment. I wasn't suggesting removing it entirely. @LewisYearsley and I are referring to the required prop type momentPropTypes.momentObj for certain props as mentioned here: https://github.com/airbnb/react-dates#daterangepicker

But your point is that since the library at the moment... depends on moment, then it's already part of your build, and you might as well use it until the Temporal proposal becomes stable. And this makes sense! 馃憤
Thanks for answering our concerns! @LewisYearsley, this can probably be closed for now?
Most helpful comment
Thanks for responding! I completely understand the dependency for

moment. I wasn't suggesting removing it entirely. @LewisYearsley and I are referring to the required prop typemomentPropTypes.momentObjfor certain props as mentioned here: https://github.com/airbnb/react-dates#daterangepickerBut your point is that since the library at the moment... depends on
moment, then it's already part of your build, and you might as well use it until the Temporal proposal becomes stable. And this makes sense! 馃憤Thanks for answering our concerns! @LewisYearsley, this can probably be closed for now?