Overview
Comment: | Fix issues with dates |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
75040297534dc4172dc475cfc2092287 |
User & Date: | bohwaz on 2020-11-26 12:18:38 |
Other Links: | branch diff | manifest | tags |
Context
2020-11-26
| ||
12:52 | Use a shorter label check-in: cd7c68df7b user: bohwaz tags: dev | |
12:18 | Fix issues with dates check-in: 7504029753 user: bohwaz tags: dev | |
2020-11-25
| ||
22:27 | Fix year is always current_year check-in: 15ae918267 user: bohwaz tags: dev, 1.0.0-beta8 | |
Changes
Modified src/include/lib/Garradin/Squelette.php from [7c031aeef9] to [1036393224].
︙ | ︙ | |||
581 582 583 584 585 586 587 | default: break; } } if (trim($loopContent)) { | | | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | default: break; } } if (trim($loopContent)) { $loop_start .= '$row[\'url\'] = Fichiers::_getURL($row[\'id\'], $row[\'nom\'], $row[\'hash\']); '; $loop_start .= '$row[\'miniature\'] = $row[\'image\'] ? Fichiers::_getURL($row[\'id\'], $row[\'nom\'], $row[\'hash\'], 200) : \'\'; '; $loop_start .= '$row[\'moyenne\'] = $row[\'image\'] ? Fichiers::_getURL($row[\'id\'], $row[\'nom\'], $row[\'hash\'], 500) : \'\'; '; } $query .= $where . ' ' . $order; if (!$limit || $limit > 100) |
︙ | ︙ |
Modified src/include/lib/Garradin/Squelette_Filtres.php from [4ef78402d4] to [d1aad48bcc].
︙ | ︙ | |||
96 97 98 99 100 101 102 | } elseif (date('Ymd', $date) == date('Ymd', strtotime('tomorrow'))) { $jour = 'demain'; } elseif (date('Y', $date) == date('Y')) { | | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | } elseif (date('Ymd', $date) == date('Ymd', strtotime('tomorrow'))) { $jour = 'demain'; } elseif (date('Y', $date) == date('Y')) { $jour = strtolower(Utils::strftime_fr($date, '%A %e %B')); } else { $jour = strtolower(Utils::strftime_fr($date, '%e %B %Y')); } if ($avec_heure) { return sprintf('%s, %s', $jour, $heure); } |
︙ | ︙ |
Modified src/include/lib/Garradin/Utils.php from [b88f9cb850] to [8eb825d6d4].
︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 | else { return null; } } static public function strftime_fr($ts, $format) { if (null === $ts) { return $ts; } | > > < > > < | < < < < < < < < < < < < < < < < < < | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | else { return null; } } static public function strftime_fr($ts, $format) { $ts = self::get_datetime($ts); if (null === $ts) { return $ts; } $date = strftime($format, $ts->getTimestamp()); $date = strtr($date, self::FRENCH_DATE_NAMES); $date = strtolower($date); return $date; } static public function date_fr($ts, $format = null) { $ts = self::get_datetime($ts); if (null === $ts) { return $ts; } if (is_null($format)) { $format = 'd/m/Y à H:i'; } $date = $ts->format($format); $date = strtr($date, self::FRENCH_DATE_NAMES); $date = strtolower($date); return $date; } /** * @deprecated */ static public function checkDate($str) { if (!preg_match('!^(\d{4})-(\d{2})-(\d{2})$!', $str, $match)) return false; |
︙ | ︙ |