Skip to content

Commit

Permalink
fix(DatePicker2): support defaultValue for quarter, close #3006
Browse files Browse the repository at this point in the history
  • Loading branch information
mwb-27 committed Nov 22, 2024
1 parent 1849be8 commit 5e0a8e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/date-picker2/picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ class Picker extends React.Component {
*/
getInitValue = () => {
const { props } = this;
const { type, value, defaultValue } = props;
const { type, value, defaultValue, format } = props;

let val = type === DATE_PICKER_TYPE.RANGE ? [null, null] : null;

val = 'value' in props ? value : 'defaultValue' in props ? defaultValue : val;

return this.checkValue(val);
return this.checkValue(val, false, format);
};

/**
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e0a8e5

Please sign in to comment.