devexpress-gantt
Advanced tools
Comparing version 4.1.49 to 4.1.50
/*! | ||
* DevExpress Gantt (dx-gantt.min) | ||
* Version: 4.1.49 | ||
* Build date: Thu Sep 14 2023 | ||
* Version: 4.1.50 | ||
* Build date: Wed Nov 15 2023 | ||
* | ||
@@ -6,0 +6,0 @@ * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED |
{ | ||
"name": "devexpress-gantt", | ||
"version": "4.1.49", | ||
"version": "4.1.50", | ||
"description": "DevExpress Gantt Control", | ||
@@ -5,0 +5,0 @@ "main": "dist/dx-gantt.min.js", |
@@ -135,3 +135,4 @@ import { Point } from "@devexpress/utils/lib/geometry/point"; | ||
const isEnd = nextDate.getTime() >= this.range.end.getTime(); | ||
const width = isStart || isEnd ? this.getRangeTickCount(currentDate, nextDate) * defWidth : defWidth; | ||
const needWidthCorrection = isStart || isEnd || (scaleType > ViewType.Hours && DateUtils.hasDST()); | ||
const width = needWidthCorrection ? this.getRangeTickCount(currentDate, nextDate) * defWidth : defWidth; | ||
items.push(new ScaleItemInfo(currentDate, nextDate, new Point(x, undefined), new Size(width, 0))); | ||
@@ -138,0 +139,0 @@ currentDate = nextDate; |
@@ -151,3 +151,3 @@ import { DateRange } from "../../Model/WorkingTime/DateRange"; | ||
public static getRangeMSPeriod(start: Date, end: Date): number { | ||
return end.getTime() - DateUtils.getDSTDelta(start, end) - start.getTime(); | ||
return end.getTime() - DateUtils.getDSTTotalDelta(start, end) - start.getTime(); | ||
} | ||
@@ -189,7 +189,36 @@ public static getRangeTickCountInMonthsViewType(start: Date, end: Date): number { | ||
} | ||
static getDSTTotalDelta(start: Date, end: Date): number { | ||
if(!DateUtils.hasDST()) return 0; | ||
let refDate = start; | ||
let delta = 0; | ||
let year = refDate.getFullYear(); | ||
let month = refDate.getMonth(); | ||
while(refDate < end) { | ||
if(month >= 5) { | ||
year++; | ||
month = 0; | ||
} | ||
else | ||
month = 5; | ||
let newRefDate = new Date(year, month, 1); | ||
if(newRefDate > end) | ||
newRefDate = end; | ||
delta += DateUtils.getDSTDelta(refDate, newRefDate); | ||
refDate = newRefDate; | ||
} | ||
return delta; | ||
} | ||
static getDSTCorrectedTaskEnd(start: Date, period: number): Date { | ||
const time = start.getTime() + period; | ||
const delta = DateUtils.getDSTDelta(start, new Date(time)); | ||
const delta = DateUtils.getDSTTotalDelta(start, new Date(time)); | ||
return new Date(time + delta); | ||
} | ||
static hasDST(): boolean { | ||
const year = (new Date()).getFullYear(); | ||
const firstJan = new Date(year, 0, 1); | ||
const firstJune = new Date(year, 5, 1); | ||
return DateUtils.getTimezoneOffsetDiff(firstJan, firstJune) !== 0; | ||
} | ||
} | ||
@@ -196,0 +225,0 @@ |
{ | ||
"name": "devexpress-gantt", | ||
"version": "4.1.49", | ||
"version": "4.1.50", | ||
"description": "DevExpress Gantt Control", | ||
@@ -5,0 +5,0 @@ "main": "dist/dx-gantt.min.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2199107
34849