Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fixed calendar weekdays not being static #41

Merged
merged 4 commits into from
May 3, 2019

Conversation

Blackbaud-TrevorBurch
Copy link
Member

No description provided.

@@ -51,7 +51,7 @@ export class SkyDatepickerComponent implements OnDestroy {
public dateChange = new EventEmitter<Date>();
public maxDate: Date;
public minDate: Date;
public startingDay: number;
public startingDay: number = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about setting the default in the calendar component, so that if undefined is passed (or set) from on-high, it will always resolve to zero when it reaches the calendar.

https://github.com/blackbaud/skyux-datetime/blob/master/src/app/public/modules/datepicker/datepicker-calendar.component.ts#L34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calendar component has its own spec, too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done.

I also noticed that with what I had that if the user actually bound to undefined we would still use that. My new version uses a getter/setter in order to ensure we use "0" if undefined is passed in.

You also may notice that I no longer have a test around this. This is because we really already had a test for this (line 131 of the datepicker-calendar spec); however, it was passing before because our test component was setting 0 by default. I have changed the test component to not send in a value unless specifically set in a test (which we do have 2 tests doing this).

@codecov
Copy link

codecov bot commented May 3, 2019

Codecov Report

Merging #41 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #41   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          26     26           
  Lines        1311   1314    +3     
  Branches      199    200    +1     
=====================================
+ Hits         1311   1314    +3
Impacted Files Coverage Δ
...odules/datepicker/datepicker-calendar.component.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c496662...6d7b9a3. Read the comment docs.

Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there already a unit test to confirm that the starting day defaults to zero?

@Blackbaud-TrevorBurch
Copy link
Member Author

Is there already a unit test to confirm that the starting day defaults to zero?

Yup. See my comment on your last comment. There was already one but the test component was manually setting the 0. I removed that piece so that the test would now test this situation and there are other tests that test when it is manually set.

@Blackbaud-TrevorBurch Blackbaud-TrevorBurch merged commit 4d6f8c6 into master May 3, 2019
@Blackbaud-TrevorBurch Blackbaud-TrevorBurch deleted the calendar-days-wrong branch May 3, 2019 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants