mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 07:26:02 +01:00
refactor(web/input): set date to current if default is set to true
This commit is contained in:
@@ -13,7 +13,7 @@ const DateField: React.FC<Props> = (props) => {
|
||||
const controller = useController({
|
||||
name: `test.${props.index}.value`,
|
||||
control: props.control,
|
||||
defaultValue: props.row.default && new Date(props.row.default),
|
||||
defaultValue: props.row.default === true ? new Date() : props.row.default ? new Date(props.row.default) : undefined,
|
||||
rules: { required: props.row.required },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user