@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");
@@ -972,10 +972,10 @@ class AnnaCalendarFilterComponent {
972
972
  }
973
973
  setInputText() {
974
974
  if (this.fromDate && this.toDate) {
975
- this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToDayjs(this.fromDate)} - ${this.annaTimeService.convertNgbDateToDayjs(this.toDate)}`;
975
+ this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)} - ${this.annaTimeService.convertNgbDateToMoment(this.toDate)}`;
976
976
  }
977
977
  else if (this.fromDate) {
978
- this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToDayjs(this.fromDate)}`;
978
+ this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)}`;
979
979
  }
980
980
  }
981
981
  }
@@ -2631,8 +2631,8 @@ class AnnaNonEditableGenericTableComponent {
2631
2631
  currentSelectedDate = this.annaFilterService.initialValueMap.get(this.annaFilterService.selectedRadio);
2632
2632
  }
2633
2633
  else {
2634
- currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.fromDate));
2635
- currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.toDate));
2634
+ currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.fromDate));
2635
+ currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.toDate));
2636
2636
  }
2637
2637
  this.annaFilterService.reOrderAppliedFiltersState(this.clonedTableData, currentSelectedDate);
2638
2638
  this.annaFilterService.tooltipSelectedMap.set(this.annaFilterService.selectedRadio, currentSelectedDate);
@@ -3189,8 +3189,8 @@ class AnnaNonEditableGenericTableComponent {
3189
3189
  currentSelectedDate = this.annaFilterService.initialValueMap.get(this.annaFilterService.selectedRadio);
3190
3190
  }
3191
3191
  else {
3192
- currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.fromDate));
3193
- currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToDayjs(currentSelectedDate.toDate));
3192
+ currentSelectedDate.fromDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.fromDate));
3193
+ currentSelectedDate.toDate = dayjs(this.annaDateTimeFormatService.convertNgbDateToMoment(currentSelectedDate.toDate));
3194
3194
  }
3195
3195
  this.isFilterChanged = !isEqual(previousSelectedDate, currentSelectedDate);
3196
3196
  }