How to use @datepicker-react/hooks - 10 common examples

To help you get started, we’ve selected a few @datepicker-react/hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tresko / react-datepicker / packages / styled / src / components / DateRangeInput / DateRangeInput.tsx View on Github external
<input value="{getInputValue(endDate," placeholder="{phrases.endDatePlaceholder}" id="{endDateInputId}"> onFocusChange(!startDate ? START_DATE : END_DATE)}
            showCalendarIcon={showEndDateCalendarIcon}
            vertical={vertical}
            isActive={focusedInput === END_DATE}
            padding={theme.dateRangeEndDateInputPadding}
            rtl={rtl}
            disableAccessibility={focusedInput === START_DATE}
            onChange={handleInputChange}
            // @ts-ignore
            dateFormat={displayFormat}
          /&gt;
        
github tresko / react-datepicker / packages / styled / src / components / DateRangeInput / DateRangeInput.tsx View on Github external
position="relative"
        ref={datepickerWrapperRef}
      &gt;
        
          <input value="{getInputValue(startDate," placeholder="{phrases.startDatePlaceholder}" id="{startDateInputId}"> onFocusChange(START_DATE)}
            showCalendarIcon={showStartDateCalendarIcon}
            vertical={vertical}
            isActive={focusedInput === START_DATE}
            padding={theme.dateRangeStartDateInputPadding}
            rtl={rtl}
            onChange={handleInputChange}
            // @ts-ignore
            dateFormat={displayFormat}
          /&gt;
          
github tresko / react-datepicker / packages / styled / src / components / DateSingleInput / DateSingleInput.tsx View on Github external
}
  }

  return (
    ) =&gt; theme || {}}&gt;
      
        <input value="{getInputValue(date," placeholder="{phrases.datePlaceholder}" id="{inputId}"> onFocusChange(true)}
          showCalendarIcon={showCalendarIcon}
          vertical={vertical}
          isActive={false}
          padding={theme.dateSingleInputPadding}
          rtl={rtl}
          onChange={handleInputChange}
          // @ts-ignore
          dateFormat={displayFormat}
        /&gt;
github tresko / react-datepicker / packages / styled / src / components / Datepicker / Datepicker.tsx View on Github external
zIndex={theme.datepickerCloseWrapperZIndex}
            &gt;
              
            
          )}

          {showSelectedDates &amp;&amp; (
github tresko / react-datepicker / packages / styled / src / components / Input / Input.tsx View on Github external
ref.current = setTimeout(() => {
      onClick()
      // @ts-ignore
      const parsedDate = parseDate(dateValue, dateFormat, new Date())

      // @ts-ignore
      if (!isNaN(parsedDate)) {
        onChange(parsedDate)
      }
    }, 1000)
  }
github tresko / react-datepicker / packages / styled / src / components / Datepicker / Datepicker.tsx View on Github external
isDateSelected,
    isFirstOrLastSelectedDate,
    isDateHovered,
    firstDayOfWeek,
    onDateSelect,
    onResetDates,
    goToPreviousMonths,
    goToNextMonths,
    numberOfMonths,
    hoveredDate,
    onDateHover,
    isDateFocused,
    focusedDate,
    onDateFocus,
    isDateBlocked: isDateBlockedFn,
  } = useDatepicker({
    startDate,
    endDate,
    focusedInput,
    onDatesChange,
    minBookingDate,
    maxBookingDate,
    minBookingDays,
    isDateBlocked,
    exactMinBookingDays,
    unavailableDates,
    initialVisibleMonth,
    numberOfMonths: numberOfMonthsProp,
    firstDayOfWeek: firstDayOfWeekProp,
  })
  useImperativeHandle(ref, () => ({
    onDateSelect: (date: Date) => {

@datepicker-react/hooks

React hooks for datepicker.

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis