mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
fix: datatime format support preview (#3572)
This commit is contained in:
parent
88b281277c
commit
0e728ca5a5
@ -65,15 +65,12 @@ const InternalExpiresRadio = (props) => {
|
|||||||
{props.options.map((v) => {
|
{props.options.map((v) => {
|
||||||
if (v.value === 'custom') {
|
if (v.value === 'custom') {
|
||||||
return (
|
return (
|
||||||
<Radio value={v.value}>
|
<Radio value={v.value} key={v.value}>
|
||||||
<Input
|
<Input
|
||||||
style={{ width: '150px' }}
|
style={{ width: '150px' }}
|
||||||
defaultValue={targetValue}
|
defaultValue={targetValue}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (
|
if (e.target.value) {
|
||||||
e.target.value &&
|
|
||||||
moment(timeFormat ? date.format() : date.toLocaleString(), e.target.value).isValid()
|
|
||||||
) {
|
|
||||||
setCustomFormatPreview(date.format(e.target.value));
|
setCustomFormatPreview(date.format(e.target.value));
|
||||||
} else {
|
} else {
|
||||||
setCustomFormatPreview(null);
|
setCustomFormatPreview(null);
|
||||||
@ -87,7 +84,11 @@ const InternalExpiresRadio = (props) => {
|
|||||||
</Radio>
|
</Radio>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return <Radio value={v.value}>{v.label}</Radio>;
|
return (
|
||||||
|
<Radio value={v.value} key={v.value}>
|
||||||
|
{v.label}
|
||||||
|
</Radio>
|
||||||
|
);
|
||||||
})}
|
})}
|
||||||
</Space>
|
</Space>
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
|
@ -1463,13 +1463,13 @@ export const SchemaSettingsDateFormat = function DateFormatConfig(props: { field
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
defaultValue: 'dddd',
|
defaultValue: 'dddd',
|
||||||
formats: ['MMMMM Do YYYY', 'YYYY-MM-DD', 'MM/DD/YY', 'YYYY/MM/DD', 'DD/MM/YYYY'],
|
formats: ['MMMM Do YYYY', 'YYYY-MM-DD', 'MM/DD/YY', 'YYYY/MM/DD', 'DD/MM/YYYY'],
|
||||||
},
|
},
|
||||||
default: dateFormatDefaultValue,
|
default: dateFormatDefaultValue,
|
||||||
enum: [
|
enum: [
|
||||||
{
|
{
|
||||||
label: DateFormatCom({ format: 'MMMMM Do YYYY' }),
|
label: DateFormatCom({ format: 'MMMM Do YYYY' }),
|
||||||
value: 'MMMMM Do YYYY',
|
value: 'MMMM Do YYYY',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: DateFormatCom({ format: 'YYYY-MM-DD' }),
|
label: DateFormatCom({ format: 'YYYY-MM-DD' }),
|
||||||
|
Loading…
Reference in New Issue
Block a user