Update value of ProFormDateRangePicker | ATLASSC.NET
Skip to main content
/// .DATA.FRAGMENT_20230601

Update value of ProFormDateRangePicker

1 minAuthor: Z.SHINCHVEN

If the value of ProFromDateRnagePicker isn't changed when you call form.setFieldValue({dateRange: [Moment, Moment]}). That might be because you passed the same instance of Moment to the ProFormDateRangePicker. You should pass a new instance of Moment to the ProFormDateRangePicker to trigger the value change.

import { ProFormDateRangePicker } from '@ant-design/pro-form';
import moment from 'moment';

const [form] = Form.useForm();

// get the value of ProFormDateRangePicker
const [start, end] = form.getFieldValue('dateRange');

// modify dateRange
start.add(1, 'day');
end.add(1, 'day');

// set new instance of Moment to ProFormDateRangePicker instead of the original
form.setFieldValue('dateRange', [moment(start), moment(end)]);
RackNerd Billboard Banner
Share node:
/// .RELATED.DATA_STREAMSShared tags

Related posts

Scanning_database_for_correlations…

/// .UPLINK.SUBSCRIBE

Keep your deck synced with every new transmission from ATLASSC.NET. Subscribe over RSS or Atom, or wire the whole archive straight into your AI assistant with the MCP server.