Skip to content

Commit

Permalink
fix(antd): fix DatePicker week formatting errors (#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxunlihuabai authored Jun 22, 2021
1 parent a49ee26 commit dbdd198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/antd/src/date-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mapDateFormat = function () {
} else if (props['picker'] === 'year') {
return 'YYYY'
} else if (props['picker'] === 'week') {
return 'YYYY-wo'
return 'gggg-wo'
}
return props['showTime'] ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'
}
Expand All @@ -39,7 +39,7 @@ const mapDateFormat = function () {
return {
...props,
format: format,
value: momentable(props.value, format === 'YYYY-wo' ? 'YYYY-w' : format),
value: momentable(props.value, format === 'gggg-wo' ? 'gggg-ww' : format),
onChange: (value: moment.Moment | moment.Moment[]) => {
if (onChange) {
onChange(formatMomentValue(value, format))
Expand Down

0 comments on commit dbdd198

Please sign in to comment.