Closed (fixed)
Project:
Duration
Version:
6.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2010 at 13:08 UTC
Updated:
19 May 2011 at 18:58 UTC
Hello,
one os the projects I am working includes only video items with short durations, mostly in 1-10 minutes.
How could we set the display to only show minutes and seconds MM:SS, excluding HH hours.
Thank you.
Comments
Comment #1
naero commentedHere ya go:
Replace themename with the name of your theme. Place this code in your template.php file.
Comment #2
naero commentedComment #4
doublejosh commentedThis works great, but fails when a piece of content DOES NOT have a duration, because it's not an object.
You need to put the get_hours() function inside the test for a duration value.
Comment #5
doublejosh commentedPushed it just a bit farther. This will drop off seconds if they aren't tracked in the node type, show days when recorded, or just hours if no days are present in the value. Going much farther and it would really need a more comprehensive switch statement for the display.