In Drupal's date and time configuration (admin/settings/date-time), you can select what day of the week it's to be considered the first.

Office hours does currently not respect this setting, so when the field is displayed, Sunday is always listed first.

Comments

Ozeuss’s picture

Status: Active » Fixed

True, and i think this is a good idea. I've added this to today's snapshot.

Status: Fixed » Closed (fixed)

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

matias’s picture

Status: Closed (fixed) » Active

I found this problem in 6.x-1.0.

Here is an easy fix:

On office_hours.theme.inc in the function "theme_office_hours_formatter_default"

Al line 29

change

if ($keys[0] != $days[$first] && in_array(t($days[$first]), $items) ) {

for

if ($keys[0] != $days[$first] && array_key_exists(t($days[$first]), $items) ) {

Ozeuss’s picture

Status: Active » Fixed

Thanks, committed to head

Status: Fixed » Closed (fixed)

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

jdanthinne’s picture

Status: Closed (fixed) » Needs review

I had the same problem with grouped values.
Here's my fix:

In office_hours.theme.inc, changed

function _office_hours_set_group_label(&$group) {
  // reference days
  $group_days = &$group['days'];
  asort($group_days);

to

function _office_hours_set_group_label(&$group) {
  // reference days
  $group_days = &$group['days'];
  $first = variable_get('date_first_day',0);
  foreach ($group_days as $day_name => $day_num) {
    if ($day_num < $first) $group_days[$day_name]+= 7;
  }
  asort($group_days);
johnv’s picture

Title: Office hours does not respect "First day of week" setting » Office hours does not respect "First day of week" setting (grouped values)

PS. group formatter is not supported in D7 (yet).

johnv’s picture

Title: Office hours does not respect "First day of week" setting (grouped values) » Office hours does not respect "First day of week" setting (grouped values formatter)
johnv’s picture

Status: Needs review » Fixed

I have added a partial backport from the D7-version in commit da3654e.

Status: Fixed » Closed (fixed)

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