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

Editor: Fix broken week display when week starts not on a Sunday #3102

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

akirk
Copy link
Member

@akirk akirk commented Feb 5, 2016

This fixes the calendar view for scheduled posts when the week doesn't start on a Sunday.

Old:
jdp7vj9int-3000x3000

New:
screen shot 2016-02-05 at 03 58 38

Problem was a strict compare between string and number.

@akirk akirk added [Type] Bug [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. i18n labels Feb 5, 2016
@akirk akirk self-assigned this Feb 5, 2016
@akirk akirk changed the title Fix broken week display when week starts not on a Sunday Editor: Fix broken week display when week starts not on a Sunday Feb 5, 2016
@akirk akirk force-pushed the fix/scheduled-posts-broken-weeks branch from 44f0694 to be68964 Compare February 5, 2016 06:53
@aduth
Copy link
Contributor

aduth commented Feb 5, 2016

@akirk : Can you provide more detail about the original bug, as I'm having a hard time reproducing the issue. Does this only occur for specific browsers, locales, or sites? Only after a specific set of reproducible steps?

@aduth
Copy link
Contributor

aduth commented Feb 5, 2016

I can confirm that this only occurs on non-English locales (in my case, broken in French language). Testing fix now...

@akirk
Copy link
Member Author

akirk commented Feb 5, 2016

@aduth it happens on locales that have the week starting on days other than Sunday (for example French or German).

@aduth
Copy link
Contributor

aduth commented Feb 5, 2016

Confirmed that fix works, and that it makes sense that the translated value is returned as a string, but that it should in fact be cast to a Number* as you've done here. 👍

* Typo on ReactDayPicker docs? I expect it should be Number, not boolean.

@aduth aduth added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 5, 2016
@akirk
Copy link
Member Author

akirk commented Feb 5, 2016

Thanks!

Typo on ReactDayPicker docs? I expect it should be Number, not boolean.

Must be. This is the code within ReactDayPicker:

if (week.length > 0 && day.getDay() === firstDayOfWeek) {

akirk added a commit that referenced this pull request Feb 5, 2016
…eeks

Editor: Fix broken week display when week starts not on a Sunday
@akirk akirk merged commit b29d2b1 into master Feb 5, 2016
@akirk akirk deleted the fix/scheduled-posts-broken-weeks branch February 5, 2016 14:39
@akirk
Copy link
Member Author

akirk commented Feb 5, 2016

Created a pull request in the react-day-picker repo: gpbl/react-day-picker#128

@aduth
Copy link
Contributor

aduth commented Feb 5, 2016

Created a pull request in the react-day-picker repo: gpbl/react-day-picker#128

OSS "Good Citizen Award" to you 👏 🏆 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. i18n [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants