In the month view, the header attribute for the the date has the wrong day name listed if the start of the week isn't set to Sunday. In my case the start of the week is set to Monday to correspond to the ISO-8601 standard for weeks. This is because we use a week view and PHP 7+ uses this standard for weeks.

I changed two for loops into foreach loops to properly deal with how Drupal reorders the week day names. I then pull the index and use that for $week_day in calendarBuildMonth and $i in calendarBuildWeek. I also changed how the multiday and single day buckets are initialized so they keep the weekDaysOredered key order.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jazzfiction created an issue. See original summary.

jazzfiction’s picture

jazzfiction’s picture

Status: Active » Needs review
eigentor’s picture

Title: Calendar month view day column header has wrong day of the week if start of the week isn't Sunday » Calendar month view day column headers attribute has wrong day of the week if start of the week isn't Sunday
eigentor’s picture

I can confirm the issue and that the patch provided by jazzfiction solves it.
I don't feel fit to do a code review though.

Neslee Canil Pinto’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
jedsaet’s picture

Straight reroll of #2.

Status: Needs review » Needs work

The last submitted patch, 7: 2937387-calendar-month-view-day-column-header-has-wrong-day-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

strozx’s picture

Status: Needs work » Needs review
FileSize
2.48 KB

I just rerolled the patch and fixed the code standard violation. I also tested the solution and it fixes the problem. I'm going to leave this on needs review if anyone else could also test.

ngkoutsaik’s picture

Assigned: Unassigned » ngkoutsaik
Status: Needs review » Needs work
ngkoutsaik’s picture

Hi,

The patch from @jedsaet applies cleanly for me. I inspected the file with code sniffer and fixed errors and warnings.

I am going to set this to review cause I made quite a few changes to the file.

However, as said above the patch works.

The last submitted patch, 11: fix_coding_standards-2937387-11.patch, failed testing. View results

ngkoutsaik’s picture

Assigned: ngkoutsaik » Unassigned
vebrovski’s picture

Rerolled the patch. Applying it solves the issue.

Status: Needs review » Needs work

The last submitted patch, 14: 2937387-14.patch, failed testing. View results

vebrovski’s picture

Status: Needs work » Needs review
rokzabukovec’s picture

Status: Needs review » Reviewed & tested by the community

The patch from #14 solves the issue of the wrong headers information. I tested it with every day as the start of the week and now the information is correct.

joelpittet’s picture

Status: Reviewed & tested by the community » Needs work

The code standard fixes, though appreciated, make it really hard to review this patch before committing. And make the patch fragile when someone does fix the Coding standards in a slightly different way.

Could someone undo the coding standards so we can just see the fix? I'll gladly review and commit this then.

ankithashetty’s picture

I don't think this issue exists anymore... Even without the patch the calendar month view's day column headers displayed correctly as we change the 'First day of week'. But looks like some did face this issue, so I have re-rolled the patch in #2 and removed the extra drupal code standard changes from it as requested in #18...

Before and After applying the patch (same result):

When 'First day of week' is set to Sunday:

When 'First day of week' is set to Wednesday:

Thank you!

Status: Needs review » Needs work

The last submitted patch, 19: 2937387-19.patch, failed testing. View results

joelpittet’s picture

Status: Needs work » Fixed

Thank you @ankithashetty and the screenshots are a nice touch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.