UI: Fixed show not correct time for device profiles scheduler preview

This commit is contained in:
Vladyslav_Prykhodko 2020-10-29 14:10:05 -04:00
parent 94addec69d
commit b9950d82e9

View File

@ -26,7 +26,7 @@ import { EntityInfoData } from '@shared/models/entity.models';
import { KeyFilter } from '@shared/models/query/query.models'; import { KeyFilter } from '@shared/models/query/query.models';
import { TimeUnit } from '@shared/models/time/time.models'; import { TimeUnit } from '@shared/models/time/time.models';
import * as _moment from 'moment-timezone'; import * as _moment from 'moment-timezone';
import { AbstractControl, FormGroup, ValidationErrors } from '@angular/forms'; import { AbstractControl, ValidationErrors } from '@angular/forms';
export enum DeviceProfileType { export enum DeviceProfileType {
DEFAULT = 'DEFAULT' DEFAULT = 'DEFAULT'
@ -513,7 +513,7 @@ export function timeOfDayToUTCTimestamp(date: Date | number): number {
} }
export function utcTimestampToTimeOfDay(time = 0): Date { export function utcTimestampToTimeOfDay(time = 0): Date {
return new Date(time + new Date().getTimezoneOffset() * 60 * 1000); return new Date(time + new Date(time).getTimezoneOffset() * 60 * 1000);
} }
function timeOfDayToMoment(date: Date | number): _moment.Moment { function timeOfDayToMoment(date: Date | number): _moment.Moment {