Author Topic: 0 Padding On Clock Not Displaying  (Read 4556 times)

T-Bone

  • Full Member
  • ***
  • Posts: 173
    • View Profile
0 Padding On Clock Not Displaying
« on: February 01, 2014, 08:28:30 AM »
If my understanding is correct, a clock format of MMSS should display time remaining with a leading 0 e.g. 09:00 with 9 minutes left in the level. I get 9:00. What am I missing?
If it ain't naked, deep-fried or poker-related, I ain't interested!

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #1 on: February 02, 2014, 01:14:16 AM »
I think that all of the various tokens that display an elapsed amount of time were updated to follow this format ... except for the <clock> token.  Sadly (to me) I don't remember if this was intentional or an oversight.  All of the elapsed time tokens that have a format attribute use the same description text, so they all explain that you can specify the format in this way, but looking at the code it won't work for <clock>.

T-Bone

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #2 on: February 02, 2014, 07:15:00 AM »
Thanks for the response, Corey. I use absolute positioning to place the clock on the screen and would like to show only minutes and seconds as our levels never exceed 30 minutes. Without the leading 0 the clock, obviously, jumps to the left at 9 minutes or less. By using the clock format and always showing hours, the clock maintains the correct positioning but I have to reduce font size to make it fit--but it does not fill the clock area the way I would like. Being an HTML novice I'm researching ways to solve the problem. So far, no luck but I'm not giving up yet.
If it ain't naked, deep-fried or poker-related, I ain't interested!

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #3 on: February 02, 2014, 09:13:04 AM »
If you're left- or center-aligning then it will jump to the left once the clock drops to under 10 minutes.  But not if you right-align.  Of course, if your clock is supposed to be centered on the screen, it will be a little off-center once it gets below 10 minutes, but that might be better than shifting to the left.

I'm not sure how your layout is setup, but if you've got the clock in an absolutely positioned <div>, for example, then I would set the width of the div to the max size it would need to be (as many pixels wide as the clock would be at 30:00, for example), center it on the screen using the top and left styles, and set the text-align to right.

T-Bone

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #4 on: February 03, 2014, 01:54:25 PM »
Did as you suggested except I set text-align to center and it seems to work pretty well. Still wish it showed leading zero when under 10 minutes (and under a minute) but--as the Stones said--You Can't Always Get What You Want!
« Last Edit: February 03, 2014, 02:45:35 PM by T-Bone »
If it ain't naked, deep-fried or poker-related, I ain't interested!

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #5 on: February 03, 2014, 09:18:51 PM »
Maybe eventually, though.  :)

I've definitely got it on my list to see why the <clock> token wasn't implemented the same way as other, similar tokens.  And look into adding another formatting attribute for HH:MM:SS format (the "HHMMSS" value of the current "format" attribute formats the time into 1h 3m 14s variations, not 1:03:14)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #6 on: February 14, 2014, 01:18:11 PM »
In trying to fix this, I see the technical reason why I didn't update the <clock> token.  But I also see that I updated the descriptive text for the token.  I probably meant to return and update it before a release and just forgot.  So it's a bug since I never did.  In working to update the <clock> token, I suddenly remembered the <hours>, <minutes>, and <seconds> tokens.  Doh!

So, you can use the following: <minutes>:<seconds>

T-Bone

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: 0 Padding On Clock Not Displaying
« Reply #7 on: February 15, 2014, 06:34:07 AM »
Man, you are the master of follow-up! Appears to work like a charm, and will be handy if/when I run a tournament with one hour levels. Thanks.
If it ain't naked, deep-fried or poker-related, I ain't interested!