1
1
Fork 0

Merge pull request #13207 from anubis2814/develop

Fix to "on this day"
This commit is contained in:
Hypolite Petovan 2023-06-09 16:15:10 -04:00 committed by GitHub
commit 5386180c0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -472,6 +472,8 @@ class Widget
// Set the start and end date to the beginning of the month // Set the start and end date to the beginning of the month
$cutoffday = $dthen; $cutoffday = $dthen;
$thisday = substr($dnow, 4); $thisday = substr($dnow, 4);
$nextday = date('Y-m-d', strtotime($dnow . ' + 1 day'));
$nextday = substr($nextday, 4);
$dnow = substr($dnow, 0, 8) . '01'; $dnow = substr($dnow, 0, 8) . '01';
$dthen = substr($dthen, 0, 8) . '01'; $dthen = substr($dthen, 0, 8) . '01';
@ -517,6 +519,7 @@ class Widget
'$showmore' => DI::l10n()->t('show more'), '$showmore' => DI::l10n()->t('show more'),
'$onthisdate' => DI::l10n()->t('On this date'), '$onthisdate' => DI::l10n()->t('On this date'),
'$thisday' => $thisday, '$thisday' => $thisday,
'$nextday' => $nextday,
'$cutoffday' => $cutoffday '$cutoffday' => $cutoffday
]); ]);

View file

@ -33,7 +33,7 @@ function showHideDates() {
<ul class="datebrowse-ul"> <ul class="datebrowse-ul">
{{if $y|cat:$thisday >= $cutoffday}} {{if $y|cat:$thisday >= $cutoffday}}
<li class="tool"> <li class="tool">
<a class="datebrowse-link" href="{{$url}}/{{$y|cat:$thisday}}/{{$y|cat:$thisday}}">{{$onthisdate}}</a> <a class="datebrowse-link" href="{{$url}}/{{$y|cat:$nextday}}/{{$y|cat:$thisday}}">{{$onthisdate}}</a>
</li> </li>
{{/if}} {{/if}}
{{foreach $arr as $d}} {{foreach $arr as $d}}