UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

28 lines (27 loc) 978 B
/** * DevExtreme (esm/renovation/ui/scheduler/view_model/to_test/views/utils/timeline_week.js) * Version: 22.1.9 * Build date: Tue Apr 18 2023 * * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import timeZoneUtils from "../../../../../../../ui/scheduler/utils.timeZone"; import { getStartViewDateWithoutDST } from "./base"; export var getDateForHeaderText = (index, date, options) => { if (!timeZoneUtils.isTimezoneChangeInDate(date)) { return date } var { cellCountInDay: cellCountInDay, interval: interval, startDayHour: startDayHour, startViewDate: startViewDate } = options; var result = getStartViewDateWithoutDST(startViewDate, startDayHour); var validIndex = index % cellCountInDay; result.setTime(result.getTime() + validIndex * interval); return result };