Overview
Comment:Make date_fr accept DateTime objects
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 369111c62629506c298ce8f622d8abcbb43d9494
User & Date: bohwaz on 2020-09-16 01:26:47
Other Links: branch diff | manifest | tags
Context
2020-09-16
01:27
Try to be coherent with PHP typehinting: use int and bool, not integer and boolean check-in: 81f1561f12 user: bohwaz tags: dev
01:26
Make date_fr accept DateTime objects check-in: 369111c626 user: bohwaz tags: dev
01:26
Unclosed aside tag check-in: acac25d2d8 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Utils.php from [6ab057f79b] to [df0debf558].

40
41
42
43
44
45
46




47


48
49
50
51
52
53
54
    static public function date_fr($format=null, $ts=null)
    {
        if (is_null($format))
        {
            $format = 'd/m/Y à H:i';
        }





        $date = date($format, $ts);


        $date = strtr($date, self::$french_date_names);
        $date = strtolower($date);
        return $date;
    }

    static public function sqliteDateToFrench($d, $short = false)
    {







>
>
>
>
|
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    static public function date_fr($format=null, $ts=null)
    {
        if (is_null($format))
        {
            $format = 'd/m/Y à H:i';
        }

        if (is_object($ts)) {
            $date = $ts->format($format);
        }
        else {
            $date = date($format, $ts);
        }

        $date = strtr($date, self::$french_date_names);
        $date = strtolower($date);
        return $date;
    }

    static public function sqliteDateToFrench($d, $short = false)
    {