#Custom time selection for date filters in admin panel

8 messages · Page 1 of 1 (latest)

silver plover
#

When filtering collections by datetime fields (e.g., createdAt) in the admin panel, only the date can be customized. The time defaults to the current time, preventing precise datetime filtering. We need a way to specify both custom date and time in filters for more accurate data querying. Is there a built-in solution or a recommended approach to achieve this functionality?

pastel ventureBOT
sharp sparrow
#

If this option is not available, it seems like more of a bug than a feature request

#

I'm not sure of a workaround for the time being, but I can look into it

silver plover
#

@sharp sparrow Thank you for your answer but can you tell me how should i change the configuration of the default react date picker in payload for the auto generated timestamps. Those configuration seem to be not available for auto generated timestamps

silver plover
#

The solution is to override the configuration for these fields in your collection schema.It will not affect the auto generation of this field and Here's how you can modify the createdAt field (and you can do the same for updatedAt):

{
  name: "createdAt",
  type: "date",
  admin: {
    hidden: true,
    date: {
      pickerAppearance: "dayAndTime",
    },
  },
},