ngx-hana-nameserver-history-viewer 1.1.9-3.beta → 1.1.9-6.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/nameserver-history-viewer/components/timezone-selector/timezone-selector.component.mjs +2 -4
- package/esm2020/src/nameserver-history-viewer/components/timezone-selector/timezone-selector.service.mjs +2 -4
- package/esm2020/src/nameserver-history-viewer/utils/time-util.mjs +2 -4
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs +6 -12
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs +6 -12
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import * as i2$1 from '@angular/forms';
|
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i1$1 from '@danielmoncada/angular-datetime-picker';
|
|
8
8
|
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
|
|
9
|
-
import * as
|
|
9
|
+
import * as moment$2 from 'moment-timezone';
|
|
10
10
|
import * as i2 from 'ngx-dropdown-list';
|
|
11
11
|
import { DropdownListModule } from 'ngx-dropdown-list';
|
|
12
12
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
@@ -511,8 +511,6 @@ function setChartHeight(nsAll, nsContent) {
|
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
-
// workaround for fixing following error when doing packagr: Cannot call a namespace ('moment')
|
|
515
|
-
const moment$4 = momentImported;
|
|
516
514
|
/**
|
|
517
515
|
* get the time range for all ports
|
|
518
516
|
*/
|
|
@@ -550,7 +548,7 @@ function _getTimeRange(time) {
|
|
|
550
548
|
* get default local time zone
|
|
551
549
|
*/
|
|
552
550
|
function getDefaultTimezone() {
|
|
553
|
-
return moment$
|
|
551
|
+
return moment$2.tz.guess();
|
|
554
552
|
}
|
|
555
553
|
/**
|
|
556
554
|
* Get time from provided timezone, using this only because chart.js doesn't support timezone.
|
|
@@ -563,8 +561,8 @@ function getTimeFromTimeZone(time, timezone) {
|
|
|
563
561
|
timezone = getDefaultTimezone();
|
|
564
562
|
console.warn(`getTimeFromTimeZone - Input timezone is null, returning the local (${timezone}) time. `);
|
|
565
563
|
}
|
|
566
|
-
const utcOffset = moment$
|
|
567
|
-
const currentOffset = moment$
|
|
564
|
+
const utcOffset = moment$2.tz.zone(timezone).utcOffset(time * 1000);
|
|
565
|
+
const currentOffset = moment$2.tz.zone(getDefaultTimezone()).utcOffset(time * 1000);
|
|
568
566
|
// convert to utc and then to selected timezone
|
|
569
567
|
return time + currentOffset * 60 - utcOffset * 60;
|
|
570
568
|
}
|
|
@@ -572,7 +570,7 @@ function getTimeFromTimeZone(time, timezone) {
|
|
|
572
570
|
* Get time formatted with the provided timezone
|
|
573
571
|
*/
|
|
574
572
|
function getTimeString(time) {
|
|
575
|
-
return moment$
|
|
573
|
+
return moment$2(time).format('YYYY-MM-DD HH:mm:ss');
|
|
576
574
|
}
|
|
577
575
|
/**
|
|
578
576
|
* Get the time range string by time array, eg: 2018-10-25 10:10:00 ~ 2018-10-25 12:12:00
|
|
@@ -762,8 +760,6 @@ function blobToFile(theBlob, fileName) {
|
|
|
762
760
|
return theBlob;
|
|
763
761
|
}
|
|
764
762
|
|
|
765
|
-
// workaround for fixing following error when doing packagr: Cannot call a namespace ('moment')
|
|
766
|
-
const moment$3 = momentImported;
|
|
767
763
|
class TimezoneSelectorService {
|
|
768
764
|
/**
|
|
769
765
|
* get the default timezone
|
|
@@ -776,7 +772,7 @@ class TimezoneSelectorService {
|
|
|
776
772
|
*/
|
|
777
773
|
getZones() {
|
|
778
774
|
const timezones = [];
|
|
779
|
-
const zones = moment$
|
|
775
|
+
const zones = moment$2.tz.names();
|
|
780
776
|
zones.forEach(zone => {
|
|
781
777
|
// get region
|
|
782
778
|
let region;
|
|
@@ -807,8 +803,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
807
803
|
type: Injectable
|
|
808
804
|
}] });
|
|
809
805
|
|
|
810
|
-
// workaround for fixing following error when doing packagr: Cannot call a namespace ('moment')
|
|
811
|
-
const moment$2 = momentImported;
|
|
812
806
|
class TimezoneSelectorComponent {
|
|
813
807
|
constructor(service) {
|
|
814
808
|
this.service = service;
|