@datarailsshared/datarailsshared 1.3.46 → 1.3.47

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.
@@ -2639,6 +2639,7 @@
2639
2639
  datePickerService.updatedQuater
2640
2640
  .pipe(operators.takeUntil(this._destroyed))
2641
2641
  .subscribe(function (value) {
2642
+ _this.tryToNormalaizeTimeframe(value, 'quarter');
2642
2643
  _this.writeValue(value);
2643
2644
  _this.onChangeCallback(value);
2644
2645
  });
@@ -2670,6 +2671,11 @@
2670
2671
  };
2671
2672
  }, 1000);
2672
2673
  };
2674
+ DrDatePickerComponent.prototype.tryToNormalaizeTimeframe = function (normalizedRef, timeframe) {
2675
+ if (this.takeEndOfPeriod) {
2676
+ normalizedRef.endOf(timeframe);
2677
+ }
2678
+ };
2673
2679
  Object.defineProperty(DrDatePickerComponent.prototype, "value", {
2674
2680
  get: function () {
2675
2681
  return this.innerValue;
@@ -2677,7 +2683,6 @@
2677
2683
  set: function (v) {
2678
2684
  if (v !== this.innerValue) {
2679
2685
  this.innerValue = v;
2680
- this.onChangeCallback(v);
2681
2686
  }
2682
2687
  this.cdr.markForCheck();
2683
2688
  },
@@ -2698,9 +2703,7 @@
2698
2703
  else {
2699
2704
  this.innerValue = value;
2700
2705
  }
2701
- if (this.takeEndOfPeriod) {
2702
- this.innerValue = moment(value).endOf(this.datePickerService.timeframe);
2703
- }
2706
+ this.tryToNormalaizeTimeframe(this.innerValue, this.datePickerService.timeframe);
2704
2707
  this.cdr.markForCheck();
2705
2708
  }
2706
2709
  };
@@ -2722,6 +2725,7 @@
2722
2725
  };
2723
2726
  DrDatePickerComponent.prototype.chosenMonthHandler = function (normalizedMonth, datepicker) {
2724
2727
  if (this.datePickerService.timeframe == 'month') {
2728
+ this.tryToNormalaizeTimeframe(normalizedMonth, 'month');
2725
2729
  this.writeValue(normalizedMonth);
2726
2730
  this.onChangeCallback(normalizedMonth);
2727
2731
  datepicker.close();
@@ -2729,6 +2733,7 @@
2729
2733
  };
2730
2734
  DrDatePickerComponent.prototype.chosenYearHandler = function (normalizedYear, datepicker) {
2731
2735
  if (this.datePickerService.timeframe == 'year') {
2736
+ this.tryToNormalaizeTimeframe(normalizedYear, 'year');
2732
2737
  this.writeValue(normalizedYear);
2733
2738
  this.onChangeCallback(normalizedYear);
2734
2739
  datepicker.close();