Posted by mikl on March 25, 2009 at 8:39pm
Jump to:
| Project: | Office Hours |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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
#1
True, and i think this is a good idea. I've added this to today's snapshot.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.
#3
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) ) {
#4
Thanks, committed to head
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
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);
#7
PS. group formatter is not supported in D7 (yet).
#8