aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-05-25 16:40:45 +0200
committerArthurHoaro <arthur@hoa.ro>2019-05-25 16:40:45 +0200
commit5321f704b563df03232e2f8a1d2a26ecb8297428 (patch)
treee099496fa676c46a792b72c661ec1777838e8436 /index.php
parentc3a04e328f2c8d40890b0b26b118a193110634ce (diff)
downloadShaarli-5321f704b563df03232e2f8a1d2a26ecb8297428.tar.gz
Shaarli-5321f704b563df03232e2f8a1d2a26ecb8297428.tar.zst
Shaarli-5321f704b563df03232e2f8a1d2a26ecb8297428.zip
Daily - display the current day instead of the previous one
Also mention if it's today or yesterday for clarity using `dayDesc` variable Fixes #1299
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.php b/index.php
index ff42114c..a14616ed 100644
--- a/index.php
+++ b/index.php
@@ -392,9 +392,16 @@ function showDailyRSS($conf, $loginManager)
392 */ 392 */
393function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager) 393function 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();