/**
 * DevExtreme (esm/ui/scheduler/workspaces/utils/timeline_week.js)
 * Version: 21.2.0 (build 21200-0321)
 * Build date: Mon Jul 19 2021
 *
 * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import timeZoneUtils from "../../utils.timeZone";
import {
    getStartViewDateWithoutDST
} from "./base";
export var getDateForHeaderText = (index, date, options) => {
    if (!timeZoneUtils.isTimezoneChangeInDate(date)) {
        return date
    }
    var {
        startDayHour: startDayHour,
        startViewDate: startViewDate,
        cellCountInDay: cellCountInDay,
        interval: interval
    } = options;
    var result = getStartViewDateWithoutDST(startViewDate, startDayHour);
    var validIndex = index % cellCountInDay;
    result.setTime(result.getTime() + validIndex * interval);
    return result
};
