Overview
Comment:Filtre squelette date_intelligente: heures facultative
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 3bf6f9e9f3c19d6266015bf315415021a377db9e
User & Date: bohwaz on 2017-08-01 05:31:37
Other Links: branch diff | manifest | tags
Context
2017-08-01
06:39
Ne pas donner de taille mini aux select par défaut check-in: b326f97d28 user: bohwaz tags: dev
05:31
Filtre squelette date_intelligente: heures facultative check-in: 3bf6f9e9f3 user: bohwaz tags: dev
01:07
Corrige les erreurs d'arrondi dans le report à nouveau (solde égal à 0,00), cf. [c20546bb90] check-in: d76c988ed8 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Squelette_Filtres.php from [78dfc10a01] to [834784360e].

72
73
74
75
76
77
78
79
80



81
82



83
84







85

86

87

88








89
90
91
92
93
94
95
    }

    static public function date_perso($date, $format)
    {
        return Utils::strftime_fr($format, $date);
    }

    static public function date_intelligente($date)
    {



        if (date('Ymd', $date) == date('Ymd'))
            return 'Aujourd\'hui, '.date('H\hi', $date);



        elseif (date('Ymd', $date) == date('Ymd', strtotime('yesterday')))
            return 'Hier, '.date('H\hi', $date);







        elseif (date('Y', $date) == date('Y'))

            return strtolower(Utils::strftime_fr('%e %B, %Hh%M', $date));

        else

            return strtolower(Utils::strftime_fr('%e %B %Y', $date));








    }

    static public function date_atom($date)
    {
        return date(DATE_ATOM, $date);
    }








|

>
>
>

<
>
>
>

<
>
>
>
>
>
>
>

>
|
>

>
|
>
>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84

85
86
87
88

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    }

    static public function date_perso($date, $format)
    {
        return Utils::strftime_fr($format, $date);
    }

    static public function date_intelligente($date, $avec_heure = true)
    {
        $jour = null;
        $heure = date('H\hi', $date);

        if (date('Ymd', $date) == date('Ymd'))

        {
            $jour = 'aujourd\'hui';
        }
        elseif (date('Ymd', $date) == date('Ymd', strtotime('yesterday')))

        {
            $jour = 'hier';
        }
        elseif (date('Ymd', $date) == date('Ymd', strtotime('tomorrow')))
        {
            $jour = 'demain';
        }
        elseif (date('Y', $date) == date('Y'))
        {
            $jour = strtolower(Utils::strftime_fr('%e %B', $date));
        }
        else
        {
            $jour = strtolower(Utils::strftime_fr('%e %B %Y', $date));
        }

        if ($avec_heure)
        {
            return sprintf('%s, %s', $jour, $heure);
        }

        return $jour;
    }

    static public function date_atom($date)
    {
        return date(DATE_ATOM, $date);
    }