Questions tagged [react-dates]

An easily internationalizable, mobile-friendly datepicker library for the web developed by Airbnb.

An easily internationalizable, mobile-friendly datepicker library for the web developed by Airbnb.

155 questions
1
vote
1 answer

react-select inside react-dates doesn't update select value

I'm using react-dates for a simple birthday picker. I'm using the renderMonthElement prop to render 2 selects on top of the datepicker for months and years: Whenever I select a month, the calendar updates correctly however the value shown in the…
Martin Conde
  • 345
  • 3
  • 15
1
vote
1 answer

react-dates: disabling the default calendar popup

ReactDateRangePicker, gives it's own date picker to use: I actually want this field only and do not want the default calendar date range picker, I have my own date picker that I'd like to place using custom css positioning when the focus changes.…
juztcode
  • 1,196
  • 2
  • 21
  • 46
1
vote
1 answer

making a dropdown selector date for airbnb SingleDatePicker

I've got my setup like this, I'm absolutely squeezing the limits of what is possible from outside a library: const [customDate, setCustomDate] = useState(moment()); const [focused, setFocused] = useState(false);) const onDropDownChangeMonth = ()=>{ …
juztcode
  • 1,196
  • 2
  • 21
  • 46
1
vote
1 answer

how do I set the min and max date for date fields?

I am developing start date and end date field screen using React JS and Bootstrap now I need add validation for end date field. For example : start date 01/01/2021 end date should allow to select from 01/01/2021(start date) up to 3…
1
vote
1 answer

How set the validation between start date and end date should select with in the 3 years

I am new to react JS, how can I achieve the validation between two date fields in React JS. for example: End dates should allow to select only within 3 years based on start date. class MyForm extends React.Component { constructor(props) { …
1
vote
1 answer

TypeError: Cannot read property 'onMonthSelect' of undefined while using "useRef"

i am trying to use useRef in my react functional component, but when i try to access it I am getting error "TypeError: Cannot read property 'onMonthSelect' of undefined while using "useRef" " . Here is the code below for this import React, { useRef,…
Ratnabh Kumar Rai
  • 554
  • 2
  • 7
  • 24
1
vote
0 answers

react-dates how to load moment.js async in next.js

I am using react-dates in my next.js project. Right now I am working on localisation. As I am very keen on having a good performance I don't want to import moment.js synchronous as it is very heavy according to bundlephobia and my own experience…
1
vote
1 answer

How to focus on input field when react-dates SingleDatePicker closes?

Is there a way to set focus on input field when SingleDatePicker closes? The problem is the input is tied directly to the Calendar, so whenever a user clicks on the input field, it automatically renders the Calendar as well. Current…
jyoo
  • 47
  • 1
  • 6
1
vote
2 answers

Using react-dates with Typescript

I am trying to use react-dates with Typescript, but cannot figure out how to define the types. The following TS/React code is giving the error Argument of type '"startDate" | "endDate" | null' is not assignable to parameter of type…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
1
vote
1 answer

react-dates onDatesChange startDate and endDate are null, DayPickerRangeController

This is DayPickerRangeController component from react-dates:
gdfgdfg
  • 3,181
  • 7
  • 37
  • 83
1
vote
1 answer

react-dates broken - not recognising css?

I have created a simple datepicker component based on react-dates and implemented as per documentation at https://github.com/airbnb/react-dates The datepicker seems to be working however the calendar styling is completely broken when clicking on the…
nickornotto
  • 1,946
  • 4
  • 36
  • 68
1
vote
0 answers

How to inject dates to react-dates library the other way around?

I am building a project using DateRangePicker in react-dates. Is there a way I can inject dates to DateRangePicker on the other way around? Suppose I get dates check_in: 2020-11-03, check_out: 2020-11-15 from query parameters and I want to display…
GoonGamja
  • 1,936
  • 5
  • 20
  • 46
1
vote
5 answers

How to find sunday 9 weeks ago irrespective of what day of the week today is using JavaScript

Hope someone can help me. I am trying to write a function to find the sunday 9 weeks ago irrespective of what day of the week today is using javascript. I I tried with moment().day(-56) but its not working. Any other way we can do this?
Praveen
  • 11
  • 1
1
vote
2 answers

How to set enddate to null if startdate is set before prevstartdate using react?

i want to allow user to select the start and end dates on the calendar. i am using react-dates for this. i want it to work like below initially start and enddates will be null. on first click when user selects start date say 10th oct then enddate is…
saritha
  • 619
  • 2
  • 12
  • 25
1
vote
1 answer

react-dates library's render issue for most of the components

I am trying to use airbnb's react-dates on my project. You can get the project here https://codesandbox.io/s/react-date-nufy9?file=/src/App.js I am following the documentation of react-dates, but somehow my app fails when I use react-dates's…
Mithhu
  • 145
  • 1
  • 7
1 2
3
10 11