...DateField(
{
name: "my_date",
label: "My Date",
required: true,
defaultValue: () => new Date(new Date().getFullYear(), 0, 1),
admin: {
date: {
displayFormat: "MMMM dd",
},
},
},
{
// here are the timezone settings
enable: true,
overrides: {
name: "my_timezone",
required: true,
defaultValue: "America/New_York",
admin: {
// this will not work
hidden: true,
},
// this will not work
access: {
update: () => false,
},
},
}
),
Being able to set overrides.access and overrides.admin.hidden to the timezone parameter of the field, and have the options impact the timezone select component would be amazing. custom alternative params outside of overrides would be an equally viable option.
We may not always want to allow the user to select a timezone, but just set one by default (and have it display that way accordingly).
A much nicer to have goal in this same vein would be if we could somehow set a timezone parameter to the date field based on the document data (such as different timezone fields, timezones within relationships, etc).
The following will not work :
Being able to set
overrides.access
andoverrides.admin.hidden
to the timezone parameter of the field, and have the options impact the timezone select component would be amazing. custom alternative params outside ofoverrides
would be an equally viable option.We may not always want to allow the user to select a timezone, but just set one by default (and have it display that way accordingly).
A much nicer to have goal in this same vein would be if we could somehow set a timezone parameter to the date field based on the document data (such as different timezone fields, timezones within relationships, etc).