ngx-hana-nameserver-history-viewer 1.1.9-5.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/fesm2015/ngx-hana-nameserver-history-viewer.mjs +6 -10
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs +6 -10
- 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 moment$
|
|
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';
|
|
@@ -548,7 +548,7 @@ function _getTimeRange(time) {
|
|
|
548
548
|
* get default local time zone
|
|
549
549
|
*/
|
|
550
550
|
function getDefaultTimezone() {
|
|
551
|
-
return moment$
|
|
551
|
+
return moment$2.tz.guess();
|
|
552
552
|
}
|
|
553
553
|
/**
|
|
554
554
|
* Get time from provided timezone, using this only because chart.js doesn't support timezone.
|
|
@@ -561,8 +561,8 @@ function getTimeFromTimeZone(time, timezone) {
|
|
|
561
561
|
timezone = getDefaultTimezone();
|
|
562
562
|
console.warn(`getTimeFromTimeZone - Input timezone is null, returning the local (${timezone}) time. `);
|
|
563
563
|
}
|
|
564
|
-
const utcOffset = moment$
|
|
565
|
-
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);
|
|
566
566
|
// convert to utc and then to selected timezone
|
|
567
567
|
return time + currentOffset * 60 - utcOffset * 60;
|
|
568
568
|
}
|
|
@@ -570,7 +570,7 @@ function getTimeFromTimeZone(time, timezone) {
|
|
|
570
570
|
* Get time formatted with the provided timezone
|
|
571
571
|
*/
|
|
572
572
|
function getTimeString(time) {
|
|
573
|
-
return moment$
|
|
573
|
+
return moment$2(time).format('YYYY-MM-DD HH:mm:ss');
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
576
576
|
* Get the time range string by time array, eg: 2018-10-25 10:10:00 ~ 2018-10-25 12:12:00
|
|
@@ -760,8 +760,6 @@ function blobToFile(theBlob, fileName) {
|
|
|
760
760
|
return theBlob;
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
-
// workaround for fixing following error when doing packagr: Cannot call a namespace ('moment')
|
|
764
|
-
const moment$3 = moment$4;
|
|
765
763
|
class TimezoneSelectorService {
|
|
766
764
|
/**
|
|
767
765
|
* get the default timezone
|
|
@@ -774,7 +772,7 @@ class TimezoneSelectorService {
|
|
|
774
772
|
*/
|
|
775
773
|
getZones() {
|
|
776
774
|
const timezones = [];
|
|
777
|
-
const zones = moment$
|
|
775
|
+
const zones = moment$2.tz.names();
|
|
778
776
|
zones.forEach(zone => {
|
|
779
777
|
// get region
|
|
780
778
|
let region;
|
|
@@ -805,8 +803,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
805
803
|
type: Injectable
|
|
806
804
|
}] });
|
|
807
805
|
|
|
808
|
-
// workaround for fixing following error when doing packagr: Cannot call a namespace ('moment')
|
|
809
|
-
const moment$2 = moment$4;
|
|
810
806
|
class TimezoneSelectorComponent {
|
|
811
807
|
constructor(service) {
|
|
812
808
|
this.service = service;
|