novo-elements 7.4.0-next.2 → 7.4.0-next.3

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.
@@ -16,7 +16,7 @@ import { OverlayConfig, OverlayModule, CdkScrollable, OverlayContainer, Fullscre
16
16
  import * as i2 from '@angular/cdk/portal';
17
17
  import { ComponentPortal, PortalInjector, PortalModule, TemplatePortal } from '@angular/cdk/portal';
18
18
  import * as dateFns from 'date-fns';
19
- import { isSameDay, differenceInCalendarDays, isWithinRange, startOfWeek, endOfWeek, startOfMonth, addDays, isToday, isBefore, isAfter, getMonth, getYear, isDate, startOfDay, addMonths, setMonth, setYear, subMonths, parse, format, isValid } from 'date-fns';
19
+ import { isSameDay, differenceInCalendarDays, isWithinRange, startOfWeek, endOfWeek, startOfMonth, addDays, isToday, isBefore, isAfter, getMonth, getYear, isDate, startOfDay, addMonths, setMonth, setYear, subMonths, parse, format, isValid, subDays } from 'date-fns';
20
20
  import { Subject, from, of, fromEvent, merge, Subscription, interval, ReplaySubject, BehaviorSubject, combineLatest } from 'rxjs';
21
21
  import { filter, take, first, switchMap, takeUntil, debounceTime, distinctUntilChanged, startWith, debounce, map, catchError, mapTo, delay, tap } from 'rxjs/operators';
22
22
  import * as i1$2 from '@angular/platform-browser';
@@ -37741,7 +37741,6 @@ class NovoDatePickerElement {
37741
37741
  }
37742
37742
  }
37743
37743
  modelToSelection(model) {
37744
- // this.selection = this._strategy.selectionFinished();
37745
37744
  switch (this.mode) {
37746
37745
  case 'multiple':
37747
37746
  this.selection = model;
@@ -37749,7 +37748,6 @@ class NovoDatePickerElement {
37749
37748
  case 'range':
37750
37749
  case 'week':
37751
37750
  this.setRangeSelection();
37752
- break;
37753
37751
  case 'single':
37754
37752
  default:
37755
37753
  this.selection = [model];
@@ -37779,12 +37777,14 @@ class NovoDatePickerElement {
37779
37777
  }
37780
37778
  setRangeSelection() {
37781
37779
  if (this.model?.hasOwnProperty('startDate')) {
37780
+ // coming from standalone date picker
37782
37781
  const range = this.model;
37783
37782
  this.selection = [range.startDate, range.endDate].filter(Boolean);
37784
37783
  }
37785
37784
  else if (this.model?.hasOwnProperty('min')) {
37785
+ // coming from data-table filter where model end date is the beginning of the next day
37786
37786
  const range = this.model;
37787
- this.selection = [range.min, range.max].filter(Boolean);
37787
+ this.selection = [range.min, subDays(range.max, 1)].filter(Boolean);
37788
37788
  }
37789
37789
  }
37790
37790
  registerOnChange(fn) {