Skip to content

Commit

Permalink
fix(next): fix datepicker2 and datepicker format (#2887)
Browse files Browse the repository at this point in the history
  • Loading branch information
xigualzn committed Mar 1, 2022
1 parent 4e39c08 commit 9f907c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/src/date-picker/index.tsx
Expand Up @@ -48,7 +48,7 @@ const mapDateFormat = function (type?: 'month' | 'year' | 'week') {
const onChange = props.onChange
return {
...props,
format: format === 'YYYY-MM-DD HH:mm:ss' ? 'YYYY-MM-DD' : format,
format,
value: momentable(props.value, format === 'YYYY-wo' ? 'YYYY-w' : format),
onChange: (value: moment.Moment | moment.Moment[]) => {
if (onChange) {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/date-picker2/index.tsx
Expand Up @@ -49,7 +49,7 @@ const mapDateFormat = function (type?: 'month' | 'year' | 'week' | 'quarter') {
const onChange = props.onChange
return {
...props,
format: format === 'YYYY-MM-DD HH:mm:ss' ? 'YYYY-MM-DD' : format,
format,
value: momentable(props.value, format === 'YYYY-wo' ? 'YYYY-w' : format),
onChange: (value: moment.Moment | moment.Moment[]) => {
if (onChange) {
Expand Down

0 comments on commit 9f907c1

Please sign in to comment.