Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calendar range cells): handle unset date or selectedValue #2537

Merged
merged 3 commits into from
Oct 1, 2020
Merged

fix(calendar range cells): handle unset date or selectedValue #2537

merged 3 commits into from
Oct 1, 2020

Conversation

yggg
Copy link
Contributor

@yggg yggg commented Oct 1, 2020

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

d0850d4 is the main fix to handle nulls in date and selecteValue properties. date could be null because of [boundingMonth]="false", see commit description for details.
f5e2a82 and ad6442f are companion fixes for the issues I noticed when I was fixing the main issue.
f5e2a82 - input changes won't be picked up when the picker opens. See the commit description for details.
ad6442f - because boundingMonth property value affects bounding month date property, day picker should regenerate weeks when property change. See the commit description for details.

yggg added 3 commits October 1, 2020 14:23
In the `NbCalendarRangeDayCellComponent` `date` property could be
set to `null` in case it's from bounding month and user set
`boundingMonth` to false.
In all `NbCalendarRange*CellComponent` selectedValue could be defined
but has no `start` property set. It happens because users are setting
`[range]` input on `NbCalendarRangeComponent` to `{}` so `selectedValue`
is truthy.
First cd run occurs when picker class instantiated so changes
made after in the `patchWithInputs` call won't be picked up.
As it affects bounding month cells. Depending on the `boundingMonths`
value bounding month cells are set to `null` or `D`.
@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #2537 into master will increase coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2537      +/-   ##
==========================================
+ Coverage   78.89%   78.94%   +0.05%     
==========================================
  Files         253      253              
  Lines        7808     7809       +1     
  Branches      855      855              
==========================================
+ Hits         6160     6165       +5     
+ Misses       1384     1380       -4     
  Partials      264      264              
Impacted Files Coverage Δ
...lendar-day-picker/calendar-day-picker.component.ts 100.00% <ø> (ø)
...ents/calendar/calendar-range-day-cell.component.ts 89.36% <ø> (ø)
...ts/calendar/calendar-range-month-cell.component.ts 31.37% <ø> (ø)
...nts/calendar/calendar-range-year-cell.component.ts 34.78% <ø> (ø)
...heme/components/datepicker/datepicker.component.ts 87.07% <ø> (+0.07%) ⬆️
...endar-kit/services/calendar-month-model.service.ts 98.03% <0.00%> (+1.96%) ⬆️
...ramework/theme/components/toastr/toastr.service.ts 97.39% <0.00%> (+2.60%) ⬆️

@yggg yggg merged commit 0f20b9c into akveo:master Oct 1, 2020
@yggg yggg deleted the fix/calendar-handle-null-date branch October 1, 2020 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant