Moodle
  1. Moodle
  2. MDL-6102

Suppress leading zero on am/pm time

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 2.3
    • Component/s: General
    • Labels:
      None
    • Environment:
      All
    • Testing Instructions:
      Hide

      0. Ensure your server uses default English language setting. (There is no change to other languages.)
      1. Go into a forum in the afternoon (between 1.00pm and 9.59pm) and post a message. Check the time is displayed as e.g. 3:00 PM (rather than 03:00PM).

      Show
      0. Ensure your server uses default English language setting. (There is no change to other languages.) 1. Go into a forum in the afternoon (between 1.00pm and 9.59pm) and post a message. Check the time is displayed as e.g. 3:00 PM (rather than 03:00PM).
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-6102-master
    • Rank:
      1654

      Description

      I think it would look much better if the leading zero on the hours part of the time was suppressed. At the moment times look like - 02:53 PM - which looks a bit like a strange 12/24 hybrid. 2:53 PM looks better and less (potentially) confusing.

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Hello, is this thill a problem in recent 1.9.x?

          Show
          Petr Škoda added a comment - Hello, is this thill a problem in recent 1.9.x?
          Hide
          Howard Miller added a comment -

          Yes it is... see attachment.

          For example, 11:51PM (Under Topic 1) is fine as time. However,(under Topic 2) 04:46PM just looks wrong. No one (in the UK anyway) would ever write the time that way. It should be 4:46pm. 04:46 always means the time shortly before 5 in the morning and clashes with the PM.

          Granted it has looked like this for years but, IMO, it looks rough!

          Show
          Howard Miller added a comment - Yes it is... see attachment. For example, 11:51PM (Under Topic 1) is fine as time. However,(under Topic 2) 04:46PM just looks wrong. No one (in the UK anyway) would ever write the time that way. It should be 4:46pm. 04:46 always means the time shortly before 5 in the morning and clashes with the PM. Granted it has looked like this for years but, IMO, it looks rough!
          Hide
          Petr Škoda added a comment -

          Reassigning to Martin, it should be easy to change the time formats in our lang packs. I am personally not sure if that should be done in en lang pack.

          Show
          Petr Škoda added a comment - Reassigning to Martin, it should be easy to change the time formats in our lang packs. I am personally not sure if that should be done in en lang pack.
          Hide
          Sam Marshall added a comment -

          Note this bug still affects current master version...

          It doesn't affect us as we use a custom time string so we can have 24 hour clock, but I noticed it anyway and wondered if it had been reported.

          As another English speaker I can confirm that 03:53 PM is incorrect. There are no leading zeros in twelve-hour clock time.

          Show
          Sam Marshall added a comment - Note this bug still affects current master version... It doesn't affect us as we use a custom time string so we can have 24 hour clock, but I noticed it anyway and wondered if it had been reported. As another English speaker I can confirm that 03:53 PM is incorrect. There are no leading zeros in twelve-hour clock time.
          Hide
          Sam Marshall added a comment -

          I investigate this, thinking I might do code (I still might), but two notes:

          1) my comment refers to English English (as spoken in the UK). It might be that in American English or Australian English, it's more common to write 12-hour time with zero at the start. I note Howard is also from the UK...

          2) strftime does not actually support the desired time format - closest is %l which uses a space instead of the zero. If we switched we could make userdate do trim() and replace ' ' (two spaces) with ' ' (one space), assuming it doesn't already. Makes no significant difference in html but used in other places.

          Show
          Sam Marshall added a comment - I investigate this, thinking I might do code (I still might), but two notes: 1) my comment refers to English English (as spoken in the UK). It might be that in American English or Australian English, it's more common to write 12-hour time with zero at the start. I note Howard is also from the UK... 2) strftime does not actually support the desired time format - closest is %l which uses a space instead of the zero. If we switched we could make userdate do trim() and replace ' ' (two spaces) with ' ' (one space), assuming it doesn't already. Makes no significant difference in html but used in other places.
          Hide
          Sam Marshall added a comment -

          Here's the code change. Suggesting as part of 2.3; of course it could be cherry-picked into earlier versions if anyone wants. I tested with a single example page on my system, it works.

          I don't have any vested interest in this patch but will submit for review anyway - as noted, it needs to be checked with US/Australian English speakers.

          Assigned to me only because I did the code If this patch doesn't go anywhere and somebody else wants to take ownership, be my guest.

          Show
          Sam Marshall added a comment - Here's the code change. Suggesting as part of 2.3; of course it could be cherry-picked into earlier versions if anyone wants. I tested with a single example page on my system, it works. I don't have any vested interest in this patch but will submit for review anyway - as noted, it needs to be checked with US/Australian English speakers. Assigned to me only because I did the code If this patch doesn't go anywhere and somebody else wants to take ownership, be my guest.
          Hide
          Adrian Greeve added a comment -

          I personally don't see that much of an issue with having a leading zero.
          Anyway the code is fine and I checked it out with the forums and assignment mods and it worked.

          Show
          Adrian Greeve added a comment - I personally don't see that much of an issue with having a leading zero. Anyway the code is fine and I checked it out with the forums and assignment mods and it worked.
          Hide
          Sam Marshall added a comment -

          Thanks for review - submitting for integration (have rebased to latest), it sounds like there is not a problem with removing the zero in Australia etc, so I think we should because it would be beneficial in the UK.

          In the UK, if you see the time '03:52' you will assume this means three fifty-two in the early hours of the morning, so it is potentially confusing if you then don't notice the 'pm'. I say potentially - so far I'm unaware of anybody actually being confused by this, it's just people commenthing that it's wrong (same as if there's a spelling mistake somewhere).

          Show
          Sam Marshall added a comment - Thanks for review - submitting for integration (have rebased to latest), it sounds like there is not a problem with removing the zero in Australia etc, so I think we should because it would be beneficial in the UK. In the UK, if you see the time '03:52' you will assume this means three fifty-two in the early hours of the morning, so it is potentially confusing if you then don't notice the 'pm'. I say potentially - so far I'm unaware of anybody actually being confused by this, it's just people commenthing that it's wrong (same as if there's a spelling mistake somewhere).
          Hide
          Howard Miller added a comment -

          Sam - thanks for the effort on this.

          Just to reiterate... it's certainly not life or death. However, nobody in the UK would ever write a leading zero on an am/pm time like this so it looks wrong. It's small things like this that get Moodle a bad name for being a bit rough around the edges == not ''professional'' (whatever that means).

          Show
          Howard Miller added a comment - Sam - thanks for the effort on this. Just to reiterate... it's certainly not life or death. However, nobody in the UK would ever write a leading zero on an am/pm time like this so it looks wrong. It's small things like this that get Moodle a bad name for being a bit rough around the edges == not ''professional'' (whatever that means).
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Andrew Davis added a comment -

          This requires testing instructions

          Show
          Andrew Davis added a comment - This requires testing instructions
          Hide
          Sam Marshall added a comment -

          rubbish test instructions added Any advance on these...?

          Show
          Sam Marshall added a comment - rubbish test instructions added Any advance on these...?
          Hide
          Sam Hemelryk added a comment -

          Thanks Sam - tested and passed

          Show
          Sam Hemelryk added a comment - Thanks Sam - tested and passed
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This virus has been spread upstream, everybody will be infected soon. Congrats, you did it!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - This virus has been spread upstream, everybody will be infected soon. Congrats, you did it! Closing, ciao

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: