-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AdminUI] defaultValue as function not working on Calendar Day #2370
Comments
This also seems to be the case with the My schema: fields: {
createdAt: {
type: DateTime,
defaultValue: () => new Date().toISOString()
}
} This does seem to be an AdminUI issue only. Using the GraphQL playground this works fine. |
dupe #2043 |
Yes, this is a duplicate and I've just updated the documentation so that this doesn't happen again. @maximelebreton I'm sorry for the confusion please for why this must be a string: #2043 |
Actually, after #2347 the function default should work as long as |
Hey there,
I wanted to put the current day as default value on the
CalendarDay
field.So I read the fields config documentation:
And then CalendarDay config documentation
I tried to do this, but it doesn't work:
So to be sure, I tried this, and it works:
So I tried this, and it doesn't work...
So the defaultValue prop as function doesn't work...
Maybe it's related to all fields, I haven't tested it?
Personal thought:
Please switch to Typescript, we shouldn't meet anymore this kind of stuff in 2020 :)
The text was updated successfully, but these errors were encountered: