diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-06-08 14:09:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-08 14:09:07 +0200 |
commit | bd231539e93649bf623bb91703131682ad0b0db7 (patch) | |
tree | 2c3db0d64bcc6564b23e843c048c789216d3ae2e /index.php | |
parent | 86aa2486541660a78ab3e347ba12e25aae232b7c (diff) | |
parent | 5321f704b563df03232e2f8a1d2a26ecb8297428 (diff) | |
download | Shaarli-bd231539e93649bf623bb91703131682ad0b0db7.tar.gz Shaarli-bd231539e93649bf623bb91703131682ad0b0db7.tar.zst Shaarli-bd231539e93649bf623bb91703131682ad0b0db7.zip |
Merge pull request #1308 from ArthurHoaro/feature/daily-date
Daily - display the current day instead of the previous one
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -392,9 +392,16 @@ function showDailyRSS($conf, $loginManager) | |||
392 | */ | 392 | */ |
393 | function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager) | 393 | function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager) |
394 | { | 394 | { |
395 | $day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD. | ||
396 | if (isset($_GET['day'])) { | 395 | if (isset($_GET['day'])) { |
397 | $day = $_GET['day']; | 396 | $day = $_GET['day']; |
397 | if ($day === date('Ymd', strtotime('now'))) { | ||
398 | $pageBuilder->assign('dayDesc', t('Today')); | ||
399 | } elseif ($day === date('Ymd', strtotime('-1 days'))) { | ||
400 | $pageBuilder->assign('dayDesc', t('Yesterday')); | ||
401 | } | ||
402 | } else { | ||
403 | $day = date('Ymd', strtotime('now')); // Today, in format YYYYMMDD. | ||
404 | $pageBuilder->assign('dayDesc', t('Today')); | ||
398 | } | 405 | } |
399 | 406 | ||
400 | $days = $LINKSDB->days(); | 407 | $days = $LINKSDB->days(); |