@sumaris-net/ngx-components 2.0.0-rc24 → 2.0.0-rc26
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/app/shared/dates.mjs +13 -12
- package/fesm2015/sumaris-net.ngx-components.mjs +13 -11
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +13 -11
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/dates.d.ts +7 -4
|
@@ -69,7 +69,6 @@ import * as momentNamespace from 'moment';
|
|
|
69
69
|
import { isMoment, locale } from 'moment';
|
|
70
70
|
import * as i1 from '@angular/material-moment-adapter';
|
|
71
71
|
import { MatMomentDateModule } from '@angular/material-moment-adapter';
|
|
72
|
-
import 'moment-timezone';
|
|
73
72
|
import * as i11$1 from 'angular2-text-mask';
|
|
74
73
|
import { TextMaskModule } from 'angular2-text-mask';
|
|
75
74
|
import * as i10$1 from '@angular/material/datepicker';
|
|
@@ -140,6 +139,7 @@ import * as i3$2 from '@e-is/ngx-material-table';
|
|
|
140
139
|
import { ValidatorService, TableDataSource } from '@e-is/ngx-material-table';
|
|
141
140
|
import * as i4 from '@angular/cdk/text-field';
|
|
142
141
|
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
|
142
|
+
import 'moment-timezone';
|
|
143
143
|
|
|
144
144
|
const ENVIRONMENT = new InjectionToken('ENV');
|
|
145
145
|
class Environment {
|
|
@@ -2537,18 +2537,20 @@ class DateUtils {
|
|
|
2537
2537
|
static isEsModule(value) {
|
|
2538
2538
|
return value && value['__esModule'] === true;
|
|
2539
2539
|
}
|
|
2540
|
+
static set moment(value) {
|
|
2541
|
+
this.__moment = value;
|
|
2542
|
+
}
|
|
2540
2543
|
static get moment() {
|
|
2541
|
-
if
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
return this.__momentResolved;
|
|
2544
|
+
// Resolve moment, if was wrapped into a ES module
|
|
2545
|
+
if (!this.__moment) {
|
|
2546
|
+
if (this.isEsModule(momentNamespace)) {
|
|
2547
|
+
this.__moment = momentNamespace.default;
|
|
2548
|
+
}
|
|
2549
|
+
if (typeof momentNamespace['isMoment'] === 'function') {
|
|
2550
|
+
this.__moment = momentNamespace;
|
|
2551
|
+
}
|
|
2550
2552
|
}
|
|
2551
|
-
|
|
2553
|
+
return this.__moment;
|
|
2552
2554
|
}
|
|
2553
2555
|
static min(date1, date2) {
|
|
2554
2556
|
return date1 && (!date2 || date1.isSameOrBefore(date2)) ? date1 : date2;
|