[Scummvm-git-logs] scummvm-web master -> f90e1e3406848310c64f0d1e3af957c52629fe24

Thunderforge noreply at scummvm.org
Tue Jan 11 00:54:59 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
f90e1e3406 WEB: Changing getLastModified($path) to return as ISO 8601 date (#194)


Commit: f90e1e3406848310c64f0d1e3af957c52629fe24
    https://github.com/scummvm/scummvm-web/commit/f90e1e3406848310c64f0d1e3af957c52629fe24
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-01-10T18:54:57-06:00

Commit Message:
WEB: Changing getLastModified($path) to return as ISO 8601 date (#194)

We don't need second precision when showing last updated, so reducing from datetime to date. Changing to ISO 8601 has the added benefit of reducing visual complexity and also preventing the need to translate the spelled out dates.

Changed paths:
    include/FileUtils.php


diff --git a/include/FileUtils.php b/include/FileUtils.php
index c87e927d..46e9f997 100644
--- a/include/FileUtils.php
+++ b/include/FileUtils.php
@@ -1,6 +1,9 @@
 <?php
 namespace ScummVM;
 
+use DateTime;
+use DateTimeInterface;
+
 /**
 * Utility functions related to files on a file system.
 */
@@ -88,15 +91,16 @@ class FileUtils
     }
 
     /**
-    * Returns the date and time that the given file was last modified.
+    * Returns the date (in ISO 8601 format) that the given file was last modified.
     *
     * @param $path the path to the file that will be analyzed
-    * @return the date and time
+    * @return the date
     */
     public static function getLastModified($path)
     {
         $path = FileUtils::toAbsolutePathIfOnServer($path);
-        return date('F j, Y, g:i a', @filemtime($path));
+        $date = new DateTime();
+        return $date->setTimestamp(@filemtime($path))->format("Y-m-d");
     }
 
     /**




More information about the Scummvm-git-logs mailing list