fix: handle date/time only when display format not provided (#347)
This commit is contained in:
parent
2c57bc7076
commit
8be590ea89
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
yarn install --frozen-lockfile
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=8192"
|
||||||
run: |
|
run: |
|
||||||
yarn build
|
yarn build
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ collections:
|
|||||||
label: Date
|
label: Date
|
||||||
widget: datetime
|
widget: datetime
|
||||||
format: 'MMM d, yyyy'
|
format: 'MMM d, yyyy'
|
||||||
date_format: 'MMM d, yyyy'
|
time_format: false
|
||||||
required: false
|
required: false
|
||||||
- name: date_with_default
|
- name: date_with_default
|
||||||
label: Date With Deafult
|
label: Date With Deafult
|
||||||
|
@ -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";
|
return "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
|
||||||
}, [dateFormat, timeFormat]);
|
}, [dateFormat, timeFormat]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user