我正在使用@y0c/react-datepicker
中的DatePicker,我希望能够设置一个默认值,但是我不能,我已经设置了DefaultValue
或选中了一个,但是没有一个显示该值,你有什么主意吗?
<Panel>
<DatePicker onChange={onChange("DatePicker")} defaultValue='00/00/0000'/>
</Panel>
答案 0 :(得分:1)
您需要包含dayjs
,并且可以像
initialDate
<Panel>
<DatePicker
// to set default date
initialDate={dayjs("2018-06-03")}
onChange={onChange("DatePicker")}
// to format date
dateFormat="YYYY/MM/DD"
/>
</Panel>
答案 1 :(得分:0)
$query = "SELECT sc.*, dr.fullName, dr.email, dr.mobile, dr.address1, dr.town, dr.postCode, dr.utr, dr.vatNo, dr.driver_number, dr.pt, dr.siteLoc, dr.vatCharge, dr.vraRate, dr.third_party_provider
FROM scheduling sc
INNER JOIN driverReg dr ON dr.ni = sc.ni
WHERE sc.ref = '".$ref."' AND sc.excluded = 'No'";