Skip to content

Can't hide or control access for Date TimeZone field #78

@skysarwer

Description

@skysarwer

The following will not work :


...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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions