fix: handle date/time only when display format not provided (#347)

This commit is contained in:
Daniel Lautzenheiser 2023-01-13 15:44:29 -05:00 committed by GitHub
parent 2c57bc7076
commit 8be590ea89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -30,6 +30,8 @@ jobs:
yarn install --frozen-lockfile
- name: Build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
yarn build

View File

@ -217,7 +217,7 @@ collections:
label: Date
widget: datetime
format: 'MMM d, yyyy'
date_format: 'MMM d, yyyy'
time_format: false
required: false
- name: date_with_default
label: Date With Deafult

View File

@ -98,6 +98,14 @@ const DateTimeControl: FC<WidgetControlProps<string, DateTimeField>> = ({
}
}
if (timeFormat === false) {
return 'yyyy-MM-dd';
}
if (dateFormat === false) {
return 'HH:mm:ss.SSSXXX';
}
return "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
}, [dateFormat, timeFormat]);