简体   繁体   中英

Show only days in react date picker

I want to custumize my DatePicker and only show days cause i want the user to choose one or multiple day from 1 to 31 with ignoring the month and the year

I am using the date picker from "react-multi-date-picker"

<DatePicker
  id={"startDate"}
  className="form-control"
  multiple
  format="DD"
/>;

You could use a dropdown or select instead.

You can add following props as below

 <DatePicker
      id={'startDate'}
      className="form-control"
      multiple
      format="DD"
      buttons={false}
      disableYearPicker
      disableMonthPicker
    />

The prop button={false} helped, and I hid the month and the year too.

Finally, it's exactly as I wanted:

<DatePicker
            id={"startDate"}
            value={editedDates}
            className="form-control"
            multiple
            format="DD"
            buttons={false}
            disableYearPicker
            disableMonthPicker
            hideMonth
            hideYear
            hideWeekDays
          />

date picker with only days

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM