Hello my name is Roberto, I am currently looking t...
# gooddata-ui
r
Hello my name is Roberto, I am currently looking to convert an relativeDateFilter value to absoluteDateFilterValue, is there any recommendation to accomplish this conversion in the gooddata packages?
Copy code
{
  "relativeDateFilter": {
    "dataSet": {
      "uri": "/gdc/md/tuccnbdpgapeah8bxp2xo8yw0snufc2i/obj/669"
    },
    "granularity": "GDC.time.year",
    "from": -2,
    "to": 0
  }
}
to
Copy code
{
  "absoluteDateFilter": {
    "dataSet": {
      "uri": "/gdc/md/tuccnbdpgapeah8bxp2xo8yw0snufc2i/obj/669"
    },
    "from": "2021-01-01",
    "to": "2023-12-31"
  }
}
b
Hi Roberto, this looks correct, are you having any troubles with the conversion?
Also, I think this might be achievable by using different options of data filter component: https://sdk.gooddata.com/gooddata-ui/docs/date_filter_option.html
r
Hi Boris, I am looking to see if there is function available we can use for these conversions?
b
Hi Roberto, I don't think we have something out of the box, but if you are using date filter component it's just about switching one parameter.
c
@Boris could you provide an example of how Roberto could have switched one parameter using the <DateFilter> component which would somehow output a conversion of his relative date to an absolute date?