@annalib/anna-core 5.2.4 → 5.2.6

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.
@@ -2692,30 +2692,55 @@ class AnnaNonEditableGenericTableComponent {
2692
2692
  }
2693
2693
  }
2694
2694
  incrementMinute(arr) {
2695
- arr[1] = parseInt(arr[1]) + 15;
2696
- if (parseInt(arr[1]) == 60) {
2697
- arr[1] = "00";
2695
+ // increment to nearest proper interval(15,30,45)
2696
+ let min = parseInt(arr[1]);
2697
+ if (min <= 14) {
2698
+ arr[1] = "15";
2698
2699
  }
2699
- else if (parseInt(arr[1]) == 0) {
2700
- arr[1] = "00";
2700
+ else if (min >= 15 && min <= 29) {
2701
+ arr[1] = "30";
2702
+ }
2703
+ else if (min >= 30 && min <= 44) {
2704
+ arr[1] = "45";
2701
2705
  }
2702
- else if (parseInt(arr[1]) > 60) {
2703
- let res = parseInt(arr[1]) - 60;
2704
- arr[1] = res < 10 ? `0${res}` : res.toString();
2706
+ else if (min >= 45) {
2707
+ arr[1] = "00";
2705
2708
  }
2709
+ // arr[1] = parseInt(arr[1]) + 15;
2710
+ // if (parseInt(arr[1]) == 60) {
2711
+ // arr[1] = "00";
2712
+ // } else if (parseInt(arr[1]) == 0) {
2713
+ // arr[1] = "00";
2714
+ // }
2715
+ // else if(parseInt(arr[1]) > 60){
2716
+ // let res = parseInt(arr[1]) - 60;
2717
+ // arr[1] = res < 10 ? `0${res}` : res.toString();
2718
+ // }
2706
2719
  }
2707
2720
  decrementMinute(arr) {
2708
- arr[1] = parseInt(arr[1]) - 15;
2709
- if (parseInt(arr[1]) < 0) {
2710
- let res = 60 + parseInt(arr[1]);
2711
- arr[1] = res;
2712
- }
2713
- else if (parseInt(arr[1]) == 0) {
2721
+ let min = parseInt(arr[1]);
2722
+ if (min > 0 && min <= 15) {
2714
2723
  arr[1] = "00";
2715
2724
  }
2716
- else if (arr[1] < 10) {
2717
- arr[1] = `0${arr[1]}`;
2725
+ else if (min >= 16 && min <= 30) {
2726
+ arr[1] = "15";
2727
+ }
2728
+ else if (min >= 31 && min <= 45) {
2729
+ arr[1] = "30";
2730
+ }
2731
+ else if (min > 45 || min == 0) {
2732
+ arr[1] = "45";
2718
2733
  }
2734
+ // arr[1] = parseInt(arr[1]) - 15;
2735
+ // if (parseInt(arr[1]) < 0) {
2736
+ // let res = 60 + parseInt(arr[1]);
2737
+ // arr[1] = res;
2738
+ // } else if (parseInt(arr[1]) == 0) {
2739
+ // arr[1] = "00";
2740
+ // }
2741
+ // else if(arr[1] < 10){
2742
+ // arr[1]= `0${arr[1]}`;
2743
+ // }
2719
2744
  }
2720
2745
  changeStartTimeHour(increment) {
2721
2746
  if (increment) {
@@ -2773,7 +2798,7 @@ class AnnaNonEditableGenericTableComponent {
2773
2798
  let fromTime24HrFormatArr = this.annaDateTimeFormatService.convertTotwentyFourHrsFormat(this.selectedFromTime[0] + ":" + this.selectedFromTime[1] + " " + this.selectedFromTime[2], true);
2774
2799
  let fromTime24HrFormat = fromTime24HrFormatArr[0] + ":" + fromTime24HrFormatArr[1] + ":00";
2775
2800
  let toTime24HrFormatArr = this.annaDateTimeFormatService.convertTotwentyFourHrsFormat(this.selectedToTime[0] + ":" + this.selectedToTime[1] + " " + this.selectedToTime[2], true);
2776
- let toTime24HrFormat = toTime24HrFormatArr[0] + ":" + toTime24HrFormatArr[1] + ":00";
2801
+ let toTime24HrFormat = toTime24HrFormatArr[0] + ":" + toTime24HrFormatArr[1] + ":59";
2777
2802
  currentSelectedTimeFilter = { fromTime: fromTime24HrFormat, toTime: toTime24HrFormat, includeMulti: this.multiTimeCheckboxChecked,
2778
2803
  includeZero: this.zeroTimeCheckboxChecked, includeTimeRange: this.enterTimeCheckboxChecked };
2779
2804
  let isFiltered = this.annaFilterService.reOrderAppliedFiltersState(this.clonedTableData, currentSelectedTimeFilter);