Hello.

Would it be possible to group multiple days together?

I.e. instead of this:

Monday 9-5
Tuesday 9-5
Wednesday 9-5
Thursday 9-5
Friday 9-3

Could you do:
Monday -
Thursday 9 - 5
Friday 9 - 3
Saturday Closed
Sunday Closed

Thank you for your efforts!

CommentFileSizeAuthor
#7 office_hours.patch2.37 KBblaiz

Comments

Ozeuss’s picture

"Closed" stuff is related also to http://drupal.org/node/233064
Both this and grouping days are quite good suggestions, and i think in CCK6 this is even easier to implement than 5 version.

chipway’s picture

Hi,

It may be related to issue # 280807, request for multiselect on days.

Thank you

epersonae@groups.drupal.org’s picture

It would be fantastic to see this feature. Right now, displaying office hours in a GMap bubble, in particular, is pretty cumbersome. (#280807: select several days for the same hours might be asking for the same thing, but this post articulates it better, IMHO.)

Ozeuss’s picture

Status: Active » Fixed

This and multiselect are pretty different things. The author of this issues relates to the way the field is displayed, if i understood correctly.
mutliselect feature relates to the form.
anyhoo- this feature is added by default in the latest dev version.

Status: Fixed » Closed (fixed)

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

blaiz’s picture

Category: feature » bug
Status: Closed (fixed) » Active

I really need this feature on my website so I gave the dev version a try. The grouped feature works pretty much but is buggy. For instance, if I set the hours like:
Monday to Thursday: 11:30am to 2pm, 5:30pm to 10pm - Friday and Saturday: 5:30pm to 10:30pm
the result is:

Hours: 
Mon - Thu : 11:30 AM - 2:00 PM
Mon - Thu : 5:30 PM - 10:00 PM
Fri - Sat : 5:30 PM - 10:30 PM

where it should be:

Hours: 
Mon - Thu : 11:30 AM - 2:00 PM, 5:30 PM - 10:00 PM
Fri - Sat : 5:30 PM - 10:30 PM

which is ok, it's not that important, it could just look a little bit better.
But with another case, some data is just not displayed. To the previous list, If I add Sunday: 5:30pm to 10pm, it shows like:

Hours: 
Sun - Thu : 5:30 PM - 10:00 PM
Fri - Sat : 5:30 PM - 10:30 PM

And all hours from 11:30 am to 2 pm are not displayed at all.

Is development for this module still active? I searched and couldn't find any other module that can handle business hours. I will have a look at the source myself, try to fix this bug but I'm new to Drupal module development so I'm not sure I can fix this myself.

Thanks.

blaiz’s picture

StatusFileSize
new2.37 KB

Ok I rewrote some parts of the code and have it properly working.

Please note that this is my first patch, I do not know Drupal's coding conventions, I've never worked on a module before and don't really know the API. Feedback more than welcomed.

I commented out some lines that I'm pretty sure are useful but not sure how they work and what they do. I know this patch will have to be re-worked before it can be usable.

For now, I tested different configuration of hours and it works in all my test + it supports the closed days settings.

Thanks

arski’s picture

sub

arski’s picture

PS. Is this also being done for the field in Views? (I assume the formatter should be reusable, so the answer should be "yes", but just checking anyway)

Ozeuss’s picture

Status: Active » Needs review

Thanks for the patch, I'll review it shortly.

vlooivlerke’s picture

Subscribe

Tried to do the patch but it is not working against the latest version, this patch is for the old August version.

klim_’s picture

subscribe

Jerome F’s picture

Is this only a display feature? Would it be possible to group days with same opening hours in the field edit form to or provide a copy / paste ability for days with the same opening hours?

I will try this in D7 to see if it can be ported easily.

Jerome F’s picture

I wish I knew php enough to port this... Well I don't. And as far as this is a patch to office_hours.theme.inc I guess my question in #13 is beyond the scope of this issue so I created a new one: http://drupal.org/node/1168172

Anonymous’s picture

Wondering about #9 as well, i.e. grouped formatting available in Views.

Anonymous’s picture

It's working in the latest dev for me.

To group together in the node, go to content management and it's under the display tab for the node type.
To group together in views, it appears that both 'Group multiple values' must be on and 'format' must be grouped.

I have not tested against mid-day breaks.

A minor quibble, if my first day of the week in the site config is Sunday, then the grouping starts with Sunday:

Sun, Sat : Closed
Mon - Fri : 9:00 AM - 6:00 PM

Sun : Closed
Mon - Fri : 9:00 AM - 7:00 PM
Sat : 10:00 AM - 2:00 PM

I'd rather it always starts from Monday, or make it an independent option from the site config.

johnv’s picture

Status: Needs review » Fixed

I have added a partial backport from the D7-version in commit da3654e.
@blaiz, thanks for your detailed report.

Status: Fixed » Closed (fixed)

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