Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9019

Hard-coded 12-hour notation for rendering file modification times in course files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.6, 1.7, 1.8
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Environment:
      Linux, Apache 2.2.3, MySQL 5.0.27, PHP 5.1.6, Moodle 1.6.3+
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      The modification time of files listed in the course Files area is now displayed using the 12-hour notation but the a.m./p.m. part is missing in other languages than English (I tested cs_utf8, de_utf8, fr_utf8, sv_utf8). I think using the 24-hour notation would be safer. What I did was this:

      ==================================================================
      ---files/index.php (revision 333)
      +++ files/index.php (revision 334)
      @@ -738,5 +738,5 @@
      $filesafe = rawurlencode($dir);
      $filesize = display_size(get_directory_size("$fullpath/$dir"));

      • $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
        + $filedate = userdate(filemtime($filename), "%d %b %Y, %H:%M");
        print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />", 'checkbox');
        print_cell("left", "<a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\">".htmlspecialchars($dir)."</a>", 'name');
        @@ -762,5 +762,5 @@
        $filesafe = rawurlencode($file);
        $fileurlsafe = rawurlencode($fileurl);
      • $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
        + $filedate = userdate(filemtime($filename), "%d %b %Y, %H:%M");

      $selectfile = trim($fileurl, "/");

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              mixik Daniel Miksik
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: