import { absoluteDateFilterValues, isRelativeDateFilter, relativeDateFilterValues, } from "@gooddata/sdk-model";
import { DateFilterHelpers } from "@gooddata/sdk-ui-filters";
export function translateDateFilter(intl, filter, dateFormat) {
    const metadata = filterMetadata(filter);
    return metadata.type === "absolute"
        ? DateFilterHelpers.formatAbsoluteDateRange(metadata.from, metadata.to, dateFormat)
        : DateFilterHelpers.formatRelativeDateRange(metadata.from, metadata.to, metadata.granularity, intl, metadata.boundedFilter);
}
function filterMetadata(filter) {
    if (isRelativeDateFilter(filter)) {
        return { ...relativeDateFilterValues(filter), type: "relative" };
    }
    return { ...absoluteDateFilterValues(filter), type: "absolute" };
}
//# sourceMappingURL=dateFilterNaming.js.map