export function getLookerSubmissionTimestampDateFilter()

in lib/lookerUtils.ts [37:59]


export function getLookerSubmissionTimestampDateFilter(
  startDate?: string | null,
  endDate?: string | null,
  isCompleted?: boolean,
): string {
  if (isCompleted && startDate && endDate) {
    // This case covers completed experiments with defined startDate and
    // endDate from the Experimenter API, with the endDate being today or earlier.
    return `${startDate} to ${endDate}`;
  } else if (startDate) {
    // This case covers experiments that haven't reached their proposed end date.
    // This case also covers experiments that are still ongoing past their proposed
    // to prevent issues with the Looker dashboards showing no data for to dates in
    // the future.
    return `${startDate} to today`;
  } else {
    // This case covers any messages with undefined startDate and endDate.

    // Showing the last 30 complete days to ensure the dashboard isn't
    // including today which has no data yet.
    return "30 day ago for 30 day";
  }
}