How does antd DatePicker change dates dynamically?

how to change its display value dynamically?

for example, there is a button for the next day, the previous day, after clicking, you can dynamically change the display date

Apr.05,2021

use setFieldsValue with Form
Don't even think about taking out Form when you fill in the form


defaultValue

if you can't, you can try

.
value

follow the source code to see that RangePicker is bound to value, and it is really effective if you try it yourself


examples on ant design documents

import { DatePicker } from 'antd';
import moment from 'moment';

const dateFormat = 'YYYY/MM/DD';
ReactDOM.render(
  <div>
    <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> 
  </div>,
  mountNode);

just set defaultValue as a variable and click on the previous or next day to change defaultValue

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e52ee0-5a23c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e52ee0-5a23c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?