Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

javascript - Min and Max value Reactstrap Input Type Date (Calendar)

I'm trying to add a Calendar to my website that makes an appoinment and I need to make it, obviously, from today to the future. How can I do that with the Reactstrap component? Can't find on docs.

Importing the Calendar:

import { Input } from "reactstrap";

    <Input
      type="time"
      className="form-control"
      id="time-start-input"
      value={startTime}
      onChange={(e) => {
        setTime(e.target.value);
      }}
    />

How can I put a minValue to receive dates just after that date? For example:

minValue={today}

And then, disable the past.

question from:https://stackoverflow.com/questions/65845835/min-and-max-value-reactstrap-input-type-date-calendar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Regarding the doc of Reactstrap Datepicker, you can use the minDate : https://reactstrap-date-picker.afialapis.com/#mindate

<FormGroup>
        <Label>My Date Picker</Label>
        <DatePicker 
           id      = "example-datepicker" 
           minDate={"2016-05-19T12:00:00.000Z"}
        <FormText>Help</FormText>
 </FormGroup>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...