Skip to content

Feature/days of week#72

Open
yankeeinlondon wants to merge 7 commits intocibernox:masterfrom
yankeeinlondon:feature/days-of-week
Open

Feature/days of week#72
yankeeinlondon wants to merge 7 commits intocibernox:masterfrom
yankeeinlondon:feature/days-of-week

Conversation

@yankeeinlondon
Copy link

the functionality we discussed is working and was quite a simple addition but due to my poor testing skills somehow the two tests I added fail. I've commented them out for the time being to ensure nothing was broken but if you have a look I suspect you'll see what was wrong with my tests quickly.

@yankeeinlondon
Copy link
Author

any thoughts? would love to get this into master

@cibernox
Copy link
Owner

Sorry, I forgot about this. Reviewing

Copy link
Owner

@cibernox cibernox left a comment

Choose a reason for hiding this comment

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

The functionality seems to work but it also seems to unrelated changes.

let i = 0;
while (days[i]) {
let daysOfWeek = days.slice(i, i + 7);
if (!showDaysAround) {
Copy link
Owner

Choose a reason for hiding this comment

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

Why are you removing this?

Copy link
Author

Choose a reason for hiding this comment

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

handled in template instead; allows for better screen layout in the false state of this condition

number: momentDate.date(),
date: momentDate._d,
moment: momentDate,
dow: momentDate.format('ddd').toLowerCase(),
Copy link
Owner

Choose a reason for hiding this comment

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

I'd prefer dow to be more clear even if that means it has to be more verbose. dayName?

Copy link
Author

Choose a reason for hiding this comment

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

i've seen "dow" refer to day-of-week a lot but I guess it may not jump out at many people. I'll change that today but one thought is that maybe we should call dayAbbrev or dayCode as this may help to distinguish it from the more user-oriented uppercased name.

isFocused: this.get('focusedId') === id,
isCurrentMonth: momentDate.month() === calendar.center.month(),
isCurrentMonth,
isVisible: isCurrentMonth || this.get('showDaysAround'),
Copy link
Owner

Choose a reason for hiding this comment

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

I see. If tests pass then 👍

{{day.number}}
{{/if}}
</button>
{{#if day.isVisible}}
Copy link
Owner

Choose a reason for hiding this comment

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

After your changes in the component you need to do this {{if}} for every day in the month. Why do this? It seems unrelated with the overall goal of the PR, which is add data-day-of-week="{{day.dow}}" to the days.

Copy link
Author

Choose a reason for hiding this comment

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

it ensures that each day -- whether visible or not -- has a ember-power-calendar-day block in it. This makes the CSS styling easier and allows you to take fuller advantage of flexbox.

Copy link
Author

Choose a reason for hiding this comment

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

days which are "not visible" are easily targeted via the .ember-power-calendar-day--blank selector

package.json Outdated
"loader.js": "^4.0.10",
"memory-scroll": "0.2.0"
"memory-scroll": "0.2.0",
"phantomjs-prebuilt": "2"
Copy link
Owner

Choose a reason for hiding this comment

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

Can you remove phantom? Phantomjs is dead as a project is dead and the addon is tested in chrome.

Copy link
Author

Choose a reason for hiding this comment

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

yup sure, can't remember why I added it all

@@ -1,3 +1,6 @@
$cell-spacing: 2px;
Copy link
Owner

Choose a reason for hiding this comment

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

All this CSS changes also seem unrelated to the topic of the PR.

Copy link
Author

Choose a reason for hiding this comment

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

true but it is fixing an existing defect that I messaged to you about ... when days are not visible you start to have layout problems with the old styling

@yankeeinlondon
Copy link
Author

what do you need to get this accepted?

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.

2 participants