Wednesday 11 November 2020

How to add mask in antd datepicker reactjs

I want to add mask in the antd datepicker and also validate it as correct date format like dd/mm/yy this format

This is the code I've tried

<FormItem label="Date of Birth">
{getFieldDecorator("dob", {rules: [{ required: true, message:"Please input the dob!" }]})(
  <DatePicker format="DD/MM/YY" getCalendarContainer={() => document.getElementById('dobParent')} onChange={handleChange} disabledDate={disabledDate} suffixIcon={<span className="icon-calendar datepicker-block"></span>} placeholder="dd/mm/yy"/>)}
</FormItem>


from How to add mask in antd datepicker reactjs

No comments:

Post a Comment