Hi there,

I'd like to use this module for my music website to display the length of songs. I'd like to be able to format the time like this '(3:21)' rather than '3min 21sec'. Would it be possible to add a display formatter to the module which shows the values separated by commas?

Even better! Could you have a text box on the manage display page to input a php style date format string so that people can customise their output?

I ended up copying some of the code and adding a new display formatter with a format string option. A patch is attached although it was quite rushed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ksenzee’s picture

Title: Colon seperated time intervals » Colon-separated time intervals (or any other user-defined format)
Issue summary: View changes
Status: Active » Needs review
FileSize
3.83 KB

I needed this same functionality, and this patch was just the ticket. I tightened it up a bit (code style, cleaned up t(), used switch statements throughout).

Note that this formatter is not just for colon formatting: it lets you use any custom formatting you can display with a php date format string.

simon_s’s picture

Thanks, brilliant, exactly what I looked for!
Patch #1 works fine!