react-modern-calendar-datepicker icon indicating copy to clipboard operation
react-modern-calendar-datepicker copied to clipboard

required attribute

Open elyasmotazedy opened this issue 3 years ago • 2 comments

hi, how can I set the required attribute for DatePicker?

        <DatePicker
          id="selectedDay"
          value={selectedDay}
          onChange={setSelectedDay}
          shouldHighlightWeekends
          locale="fa"
          name={selectedDay}
          wrapperClassName="d-block"
        />

elyasmotazedy avatar May 03 '21 06:05 elyasmotazedy

hi,

you can use -> renderInput attribute .

image

like this:

const renderCustomInput = ({ ref }) => (
    <input .../>
);
<DatePicker
    id="selectedDay"
    value={selectedDay}
    onChange={setSelectedDay}
    shouldHighlightWeekends
    locale="fa"
    name={selectedDay}
    wrapperClassName="d-block"

    renderInput={renderCustomInput}
/>

AImani avatar Jun 01 '21 16:06 AImani

how can I change in typescript?

yoonjong-park avatar Nov 22 '21 05:11 yoonjong-park