Merge pull request #1308 from ArthurHoaro/feature/daily-date

Daily - display the current day instead of the previous one
This commit is contained in:
ArthurHoaro 2019-06-08 14:09:07 +02:00 committed by GitHub
commit bd231539e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 444 additions and 325 deletions

3
.gitignore vendored
View file

@ -47,3 +47,6 @@ tpl/default/img
tpl/vintage/js
tpl/vintage/css
tpl/vintage/img
# Documented scripts
generate_templates.php

File diff suppressed because it is too large Load diff

View file

@ -392,9 +392,16 @@ function showDailyRSS($conf, $loginManager)
*/
function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
{
$day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
if (isset($_GET['day'])) {
$day = $_GET['day'];
if ($day === date('Ymd', strtotime('now'))) {
$pageBuilder->assign('dayDesc', t('Today'));
} elseif ($day === date('Ymd', strtotime('-1 days'))) {
$pageBuilder->assign('dayDesc', t('Yesterday'));
}
} else {
$day = date('Ymd', strtotime('now')); // Today, in format YYYYMMDD.
$pageBuilder->assign('dayDesc', t('Today'));
}
$days = $LINKSDB->days();

View file

@ -44,7 +44,12 @@
</div>
</div>
<div>
<h3 class="window-subtitle">{function="format_date($dayDate, false)"}</h3>
<h3 class="window-subtitle">
{if="!empty($dayDesc)"}
{$dayDesc} -
{/if}
{function="format_date($dayDate, false)"}
</h3>
<div id="plugin_zone_about_daily" class="plugin_zone">
{loop="$daily_about_plugin"}

View file

@ -35,6 +35,9 @@
<div class="dailyDate">
<span class="nomobile">&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;</span>
{if="!empty($dayDesc)"}
{$dayDesc} -
{/if}
{function="strftime('%A %d, %B %Y', $day)"}
<span class="nomobile">&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;</span>
</div>