Welcome, Guest
Username Password: Remember me

Zero-pad the duration display
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Zero-pad the duration display

Zero-pad the duration display 01 Apr 2009 18:52 #741

I'm surprised this hasn't been fixed before now (I've noticed it for months but haven't spoken up). If the number of seconds in the duration is less than 10, the code should pad it with leading zero(es). Also, if longer than an hour (so that the Hours has a value) then the same thing should be done to the number of minutes if it is less than 10. E.g.
  • 30:07 instead of 30:7
  • 48:00 instead of 48:
  • 1:05:02 instead of 1:5:2

But if the total duration is less than 10 minutes (although this would be rare, when preachers are involved ), only apply the padding routine to the seconds, not the minutes - i.e. 8:34, not 08:34.

Without the numbers fixed to two digits, the result doesn't even look like a time, if you know what I mean.
Joomla 1.5.10, Bible Study 6.0.11

Re:Zero-pad the duration display [SOLVED (sortof)] 01 Apr 2009 20:42 #743

Sorry, I'm barking up the wrong tree, and I see that the root problem is gone. Somewhere between version 6.0.07 and 6.0.11 you apparently solved it by changing the media_hours, media_minutes, and media_seconds fields from numeric to character. (That's not how I would have done it, but that's okay.) Data entered before I upgraded still shows single digit seconds, but new data shows zero-padded seconds. Okay, I'll fix my old data. You may want to tell other users to do the same, or add a step in your upgrade installation routine to check for single-digit seconds and fix them.
Joomla 1.5.10, Bible Study 6.0.11
  • Page:
  • 1
Time to create page: 0.48 seconds