mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:55:50 +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) => {
|
||||
if (v.value === 'custom') {
|
||||
return (
|
||||
<Radio value={v.value}>
|
||||
<Radio value={v.value} key={v.value}>
|
||||
<Input
|
||||
style={{ width: '150px' }}
|
||||
defaultValue={targetValue}
|
||||
onChange={(e) => {
|
||||
if (
|
||||
e.target.value &&
|
||||
moment(timeFormat ? date.format() : date.toLocaleString(), e.target.value).isValid()
|
||||
) {
|
||||
if (e.target.value) {
|
||||
setCustomFormatPreview(date.format(e.target.value));
|
||||
} else {
|
||||
setCustomFormatPreview(null);
|
||||
@ -87,7 +84,11 @@ const InternalExpiresRadio = (props) => {
|
||||
</Radio>
|
||||
);
|
||||
}
|
||||
return <Radio value={v.value}>{v.label}</Radio>;
|
||||
return (
|
||||
<Radio value={v.value} key={v.value}>
|
||||
{v.label}
|
||||
</Radio>
|
||||
);
|
||||
})}
|
||||
</Space>
|
||||
</Radio.Group>
|
||||
|
@ -1463,13 +1463,13 @@ export const SchemaSettingsDateFormat = function DateFormatConfig(props: { field
|
||||
}
|
||||
`,
|
||||
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,
|
||||
enum: [
|
||||
{
|
||||
label: DateFormatCom({ format: 'MMMMM Do YYYY' }),
|
||||
value: 'MMMMM Do YYYY',
|
||||
label: DateFormatCom({ format: 'MMMM Do YYYY' }),
|
||||
value: 'MMMM Do YYYY',
|
||||
},
|
||||
{
|
||||
label: DateFormatCom({ format: 'YYYY-MM-DD' }),
|
||||
|
Loading…
Reference in New Issue
Block a user