Commit b9950d82e906b51ad4ce8a4039b78bef1049118d
1 parent
94addec6
UI: Fixed show not correct time for device profiles scheduler preview
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -26,7 +26,7 @@ import { EntityInfoData } from '@shared/models/entity.models'; | @@ -26,7 +26,7 @@ import { EntityInfoData } from '@shared/models/entity.models'; | ||
26 | import { KeyFilter } from '@shared/models/query/query.models'; | 26 | import { KeyFilter } from '@shared/models/query/query.models'; |
27 | import { TimeUnit } from '@shared/models/time/time.models'; | 27 | import { TimeUnit } from '@shared/models/time/time.models'; |
28 | import * as _moment from 'moment-timezone'; | 28 | import * as _moment from 'moment-timezone'; |
29 | -import { AbstractControl, FormGroup, ValidationErrors } from '@angular/forms'; | 29 | +import { AbstractControl, ValidationErrors } from '@angular/forms'; |
30 | 30 | ||
31 | export enum DeviceProfileType { | 31 | export enum DeviceProfileType { |
32 | DEFAULT = 'DEFAULT' | 32 | DEFAULT = 'DEFAULT' |
@@ -513,7 +513,7 @@ export function timeOfDayToUTCTimestamp(date: Date | number): number { | @@ -513,7 +513,7 @@ export function timeOfDayToUTCTimestamp(date: Date | number): number { | ||
513 | } | 513 | } |
514 | 514 | ||
515 | export function utcTimestampToTimeOfDay(time = 0): Date { | 515 | export function utcTimestampToTimeOfDay(time = 0): Date { |
516 | - return new Date(time + new Date().getTimezoneOffset() * 60 * 1000); | 516 | + return new Date(time + new Date(time).getTimezoneOffset() * 60 * 1000); |
517 | } | 517 | } |
518 | 518 | ||
519 | function timeOfDayToMoment(date: Date | number): _moment.Moment { | 519 | function timeOfDayToMoment(date: Date | number): _moment.Moment { |