@annalib/anna-core 4.3.0 → 4.3.1

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.
@@ -365,7 +365,7 @@ class AnnaDateTimeFormatService {
365
365
  results = a.seconds() < b.seconds() ? 1 : a.seconds() > b.seconds() ? -1 : 0;
366
366
  return results;
367
367
  }
368
- convertNgbDateToDayjs(ngbDate) {
368
+ convertNgbDateToMoment(ngbDate) {
369
369
  let converted = dayjs();
370
370
  converted.month(ngbDate.month - 1);
371
371
  converted.date(ngbDate.day);
@@ -601,12 +601,12 @@ class AnnaWeekCalendarComponent {
601
601
  }
602
602
  }
603
603
  getWeekNumber(week, firstDayOfWeek) {
604
- const weekStartDate = dayjs(convertNgbDateTodayjs(week[0]), "MM/DD/YYYY");
604
+ const weekStartDate = dayjs(convertNgbDateToMoment(week[0]), "MM/DD/YYYY");
605
605
  const weekYear = weekStartDate.year();
606
606
  const yearStartDate = dayjs(`01/01/${weekYear}`, "MM/DD/YYYY");
607
607
  const weekDay = yearStartDate.day();
608
608
  const noOfDays = weekStartDate.diff(yearStartDate, "d") + 1;
609
- function convertNgbDateTodayjs(ngbDate) {
609
+ function convertNgbDateToMoment(ngbDate) {
610
610
  let converted = dayjs();
611
611
  converted.month(ngbDate.month - 1);
612
612
  converted.date(ngbDate.day);
@@ -686,8 +686,8 @@ class AnnaWeekCalendarComponent {
686
686
  this.toDate = this.constructEndDate(dateObject)(constructDate);
687
687
  }
688
688
  if (this.disabledDates.length > 0) {
689
- let dayjsStartDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(this.fromDate), "MM/DD/YYYY");
690
- let dayjsEndDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(this.toDate), "MM/DD/YYYY");
689
+ let dayjsStartDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(this.fromDate), "MM/DD/YYYY");
690
+ let dayjsEndDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(this.toDate), "MM/DD/YYYY");
691
691
  let ngbDate;
692
692
  while (!dayjsStartDate.isSame(dayjsEndDate)) {
693
693
  ngbDate = this.annaDateTimeFormatService.convertToNgbDate(dayjsStartDate, "MM/DD/YYYY");
@@ -970,10 +970,10 @@ class AnnaCalendarFilterComponent {
970
970
  }
971
971
  setInputText() {
972
972
  if (this.fromDate && this.toDate) {
973
- this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToDayjs(this.fromDate)} - ${this.annaTimeService.convertNgbDateToDayjs(this.toDate)}`;
973
+ this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)} - ${this.annaTimeService.convertNgbDateToMoment(this.toDate)}`;
974
974
  }
975
975
  else if (this.fromDate) {
976
- this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToDayjs(this.fromDate)}`;
976
+ this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)}`;
977
977
  }
978
978
  }
979
979
  }
@@ -2629,8 +2629,8 @@ class AnnaNonEditableGenericTableComponent {
2629
2629
  currentSelectedDate = this.annaFilterService.initialValueMap.get(this.annaFilterService.selectedRadio);
2630
2630
  }
2631
2631
  else {
2632
- currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.fromDate));
2633
- currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.toDate));
2632
+ currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.fromDate));
2633
+ currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.toDate));
2634
2634
  }
2635
2635
  this.annaFilterService.reOrderAppliedFiltersState(this.clonedTableData, currentSelectedDate);
2636
2636
  this.annaFilterService.tooltipSelectedMap.set(this.annaFilterService.selectedRadio, currentSelectedDate);
@@ -3187,8 +3187,8 @@ class AnnaNonEditableGenericTableComponent {
3187
3187
  currentSelectedDate = this.annaFilterService.initialValueMap.get(this.annaFilterService.selectedRadio);
3188
3188
  }
3189
3189
  else {
3190
- currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.fromDate));
3191
- currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.toDate));
3190
+ currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.fromDate));
3191
+ currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.toDate));
3192
3192
  }
3193
3193
  this.isFilterChanged = !isEqual(previousSelectedDate, currentSelectedDate);
3194
3194
  }