Hi everyone, has anyone figured out how to remove ...
# gooddata-cloud
m
Hi everyone, has anyone figured out how to remove Hours and Minutes from the Date filters when they are added to a dashboard? In my data model the granularities are disabled and they are hidden as expected within the Analyze page for building reports but using the filter on an actual dashboard it still shows those Hour and Minute options which when selected result in no data loading, I would like to hide them on the dashboard as well if possible
k
Yes, you can hide Hours and Minutes from the date filters on dashboards in GoodData Cloud. There are two approaches you can use: ## Using dateFilterConfig (Recommended for Dashboards) You can customize which granularities appear in dashboard date filters using the
dateFilterConfig
metadata object. This configuration can be set at either the organization or workspace level via API. To remove hour and minute granularities, you need to edit the
relativeForm.granularities
section to include only the granularities you want to display. For example, to show only days, weeks, months, quarters, and years:
Copy code
json "relativeForm": {   "granularities": [     "GDC.time.date",     "GDC.time.week_us",     "GDC.time.month",     "GDC.time.quarter",     "GDC.time.year"   ],   "localIdentifier": "relativeForm",   "name": "relativeForm",   "visible": true }
You can configure this by sending a POST request to: - Organization level:
/api/v1/entities/organizationSettings
- Workspace level:
/api/v1/entities/workspaces/{workspaceId}/workspaceSettings
For detailed instructions and examples, see the [Date Filter Documentation](https://www.gooddata.com/docs/gooddata-ui/latest/references/filters/date_filter/#how-to-modify-date-filters-in-dashboards). ## LDM Configuration While you mentioned you've already disabled these granularities in your data model, it's worth confirming this is properly configured. In the data modeler, you can select the date dimension, click "details," and uncheck the granularities you don't want to support, as mentioned in [this community discussion](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1712755018963459?thread_ts=1712755018.963459&cid=C04S1MSLEAW). However, based on your description, the
dateFilterConfig
approach is what you need to control the dashboard filter UI specifically, as the LDM settings alone may not hide these options from the dashboard date filter interface.
m
I did try this at the organisation level and my config returns as the above but it's still showing hour and minute in the dashboard
@kapa.ai
k
Sorry @Mitch Gammie, I'm not sure what you mean. Please try again. 👋
m
@kapa.ai I did try this at the organisation level and my config returns as the above but it's still showing hour and minute in the dashboard, should I be using a different request for the date filter vs the relative options?
k
A message from kapa.ai
Based on the knowledge sources, there are actually two different configuration areas you need to consider for controlling granularities in dashboard date filters: ## 1. Relative Form vs. Available Granularities The
relativeForm.granularities
configuration controls the Relative Period form specifically. However, there's a separate configuration for the Static Period (also called "Floating range form") that uses
availableGranularities
. According to the [API documentation](https://sdk.gooddata.com/gooddata-ui-apidocs/v11.7.0/docs/sdk-ui-dashboard.idashboarddatefilterconfig.availablegranularities.html#idashboarddatefilterconfigavailablegranularities-property), the
IDashboardDateFilterConfig.availableGranularities
property controls "Granularities available in the Floating range form." ## 2. Using hideGranularities Additionally, there's a
hideGranularities
property that you can use to explicitly hide specific granularities from the date filter dropdown. According to the [API documentation](https://sdk.gooddata.com/gooddata-ui-apidocs/v11.7.0/docs/sdk-model.idashboarddatefilterconfig.hidegranularities.html#idashboarddatefilterconfighidegranularities-property), this property allows you to specify "Date filter granularities to hide in the date filter dropdown for the current dashboard." ## Recommended Configuration Your
dateFilterConfig
should include both configurations:
Copy code
json {   "config": {     "relativeForm": {       "granularities": [         "GDC.time.date",         "GDC.time.week_us",         "GDC.time.month",         "GDC.time.quarter",         "GDC.time.year"       ],       "localIdentifier": "relativeForm",       "name": "relativeForm",       "visible": true     },     "availableGranularities": [       "GDC.time.date",       "GDC.time.week_us",       "GDC.time.month",       "GDC.time.quarter",       "GDC.time.year"     ],     "hideGranularities": [       "GDC.time.hour",       "GDC.time.minute"     ]   } }
Try updating your configuration to include the
availableGranularities
and/or
hideGranularities
properties, as these control different aspects of the date filter UI beyond just the relative form.