Browse Source
Merge pull request #8834 from ChantsovaEkaterina/bug/widget-data-not-loading-for-particular-timewindow-intervals
Fixed loading widget data for 'previous quarter' and 'previous half year' timewindow intervals
pull/8849/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
ui-ngx/src/app/shared/models/time/time.models.ts
|
|
|
@ -452,6 +452,15 @@ export const calculateIntervalStartTime = (interval: QuickTimeInterval, currentD |
|
|
|
case QuickTimeInterval.PREVIOUS_MONTH: |
|
|
|
currentDate.subtract(1, 'months'); |
|
|
|
return currentDate.startOf('month'); |
|
|
|
case QuickTimeInterval.PREVIOUS_QUARTER: |
|
|
|
currentDate.subtract(1, 'quarter'); |
|
|
|
return currentDate.startOf('quarter'); |
|
|
|
case QuickTimeInterval.PREVIOUS_HALF_YEAR: |
|
|
|
if (currentDate.get('quarter') < 3) { |
|
|
|
return currentDate.startOf('year').subtract(2, 'quarters'); |
|
|
|
} else { |
|
|
|
return currentDate.startOf('year'); |
|
|
|
} |
|
|
|
case QuickTimeInterval.PREVIOUS_YEAR: |
|
|
|
currentDate.subtract(1, 'years'); |
|
|
|
return currentDate.startOf('year'); |
|
|
|
|