monkey-style-guide 2.0.90 → 2.0.91
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/bundles/monkey-style-guide.umd.js +19 -8
- package/bundles/monkey-style-guide.umd.js.map +1 -1
- package/esm2015/lib/components/date-range-picker/date-range-picker.component.js +20 -9
- package/esm2015/lib/components/date-range-picker/date-range-picker.component.ngsummary.json +1 -1
- package/fesm2015/monkey-style-guide.js +19 -8
- package/fesm2015/monkey-style-guide.js.map +1 -1
- package/lib/components/date-range-picker/date-range-picker.component.d.ts +1 -0
- package/monkey-style-guide-2.0.91.tgz +0 -0
- package/package.json +1 -1
- package/monkey-style-guide-2.0.90.tgz +0 -0
|
@@ -2306,6 +2306,10 @@
|
|
|
2306
2306
|
this._daysArrFirst = this.createCalendar(this._dateFirst);
|
|
2307
2307
|
this._daysArrSecond = this.createCalendar(this._dateSecond);
|
|
2308
2308
|
};
|
|
2309
|
+
MonkeyDateRangePickerComponent.prototype.clearDates = function () {
|
|
2310
|
+
this._dateForm.setValue({ startDate: null, endDate: null });
|
|
2311
|
+
this.writeValue(this._dateForm.value);
|
|
2312
|
+
};
|
|
2309
2313
|
MonkeyDateRangePickerComponent.prototype.navigateToToday = function () {
|
|
2310
2314
|
this._dateFirst = moment();
|
|
2311
2315
|
this._dateSecond = moment().add(1, 'M');
|
|
@@ -2385,17 +2389,24 @@
|
|
|
2385
2389
|
var _dateForm = this._dateForm;
|
|
2386
2390
|
var dayFormatted = day.format('YYYY-MM-DD');
|
|
2387
2391
|
if (_dateForm.valid) {
|
|
2388
|
-
|
|
2389
|
-
this.writeValue(_dateForm.value);
|
|
2390
|
-
return;
|
|
2392
|
+
this.clearDates();
|
|
2391
2393
|
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
+
var _a = _dateForm.value, startDate = _a.startDate, endDate = _a.endDate;
|
|
2395
|
+
if (startDate) {
|
|
2396
|
+
if (moment(startDate).isAfter(moment(dayFormatted))) {
|
|
2397
|
+
endDate = startDate;
|
|
2398
|
+
startDate = dayFormatted;
|
|
2399
|
+
}
|
|
2394
2400
|
}
|
|
2395
|
-
else
|
|
2396
|
-
|
|
2397
|
-
|
|
2401
|
+
else
|
|
2402
|
+
startDate = dayFormatted;
|
|
2403
|
+
if (startDate) {
|
|
2404
|
+
_dateForm.get('startDate').patchValue(startDate);
|
|
2405
|
+
}
|
|
2406
|
+
if (endDate) {
|
|
2407
|
+
_dateForm.get('endDate').patchValue(endDate);
|
|
2398
2408
|
}
|
|
2409
|
+
this.writeValue(_dateForm.value);
|
|
2399
2410
|
};
|
|
2400
2411
|
MonkeyDateRangePickerComponent.prototype.selectRangeOfDays = function (days) {
|
|
2401
2412
|
var _a = this, _dateForm = _a._dateForm, today = _a.today;
|