The attached patch will define the following for the 7.x module:
- Formatter to output data in a HTML table
- Formatter to output data as a Google Places string, for use in mass upload
- Formatter setting to use short day notation instead of full (Sun. instead of Sunday).

It would be greatly appreciated if this patch could be reviewed and applied to the 7.x branch.

Comments

johnv’s picture

subscribe

arrow’s picture

Status: Active » Needs review
StatusFileSize
new15.74 KB

This patch wouldn't apply to the sept 14 dev, so I rebuilt it.. also cleaned up some whitespace.

johnv’s picture

This reworked patch has the following features:
- it adds a new formatter 'in-line' , next to the existing 'default' formatter. This allows to export the office hours to e.g. Google Places via a Views display.
- it adds new settings for both formatters:
-- set Day notation to long/short/numeric/none
-- set separators between each component of an 'office hour'.
-- set 'show closed days' (moved from field settings to formatter settings)
-- set a translatable html-text for the 'Closed' text.
-- 'compress' the hours if you have set 'more hours' (necessary for the Google places, which to not allow mid-day breaks.)
Consequently, there are 'settings' the Manage Display section of the Content Type Administration.

The default formatter has changed a bit, so the hours are aligned better vertically, and now supports short-day-notation out of the box.
Examples: You can now create formatters like:
'Mon: 9:00-12:00 and 13:00-17:00'
'Tue: Sorry we're closed, Hope 2CU another day!'
or an inline string for Google: '2:10:00:18:00,3:10:00:18:00,4:10:00:18:00,5:10:00:18:00,6:10:00:18:00,7:12:00:20:00'

The following is marked as todo, but I leave that to the experts:
-- Extended formatter for hours notation, so you can set '09:30' vs '9:00', etc.
-- Check if the span's/div's are correct, and if some data must go into the css files.

Although the 'Closed' text is customizable now, it is not per day. If you need 'Sun: Closed' and 'Mon: appointments only', we need somthing like #1119406: Add a "description" feature .

johnv’s picture

Title: [PATCH] Add new formatters » New formatter (inline vs. tabular) + more settings per formatter (day notation, separator)
StatusFileSize
new15.12 KB

Here's the patch.

johnv’s picture

Perhaps the formatter can better use the standard date-formats: http://us.php.net/manual/en/function.date.php

Ozeuss’s picture

Johnv, I can't seem to apply the patch, any chance you could re-roll it?

johnv’s picture

StatusFileSize
new15.92 KB

This one should do it.
please pay attention to my usage of div's and classes - it's not one of my qualities.

mikeytown2’s picture

StatusFileSize
new15.76 KB

#7 did not apply for me; This patch applies against the latest dev.

arrow’s picture

StatusFileSize
new14.15 KB

Neither of the previous apply to the latest dev... Here's another:

johnv’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

removed personal data