Merge pull request #13198 from anubis2814/develop

On this date option in the archives
This commit is contained in:
Hypolite Petovan 2023-06-06 08:54:26 -04:00 committed by GitHub
commit ae45a177a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 11 deletions

View file

@ -470,8 +470,11 @@ class Widget
if ($dthen) {
// Set the start and end date to the beginning of the month
$cutoffday = $dthen;
$thisday = substr($dnow, 4);
$dnow = substr($dnow, 0, 8) . '01';
$dthen = substr($dthen, 0, 8) . '01';
/*
* Starting with the current month, get the first and last days of every
@ -491,6 +494,7 @@ class Widget
$ret[$dyear][] = [$str, $end_month, $start_month];
$dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d');
}
}
@ -510,7 +514,10 @@ class Widget
'$url' => $url,
'$dates' => $ret,
'$showless' => DI::l10n()->t('show less'),
'$showmore' => DI::l10n()->t('show more')
'$showmore' => DI::l10n()->t('show more'),
'$onthisdate' => DI::l10n()->t('On this date'),
'$thisday' => $thisday,
'$cutoffday' => $cutoffday
]);
return $o;

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2023.09-dev\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:44-0400\n"
"POT-Creation-Date: 2023-06-05 22:08-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1597,7 +1597,7 @@ msgid ""
msgstr ""
#: src/Content/GroupManager.php:151 src/Content/Nav.php:276
#: src/Content/Text/HTML.php:877 src/Content/Widget.php:533
#: src/Content/Text/HTML.php:877 src/Content/Widget.php:540
msgid "Groups"
msgstr ""
@ -1605,12 +1605,12 @@ msgstr ""
msgid "External link to group"
msgstr ""
#: src/Content/GroupManager.php:157 src/Content/Widget.php:512
#: src/Content/GroupManager.php:157 src/Content/Widget.php:516
msgid "show less"
msgstr ""
#: src/Content/GroupManager.php:158 src/Content/Widget.php:414
#: src/Content/Widget.php:513
#: src/Content/Widget.php:517
msgid "show more"
msgstr ""
@ -2185,27 +2185,31 @@ msgid_plural "%d contacts in common"
msgstr[0] ""
msgstr[1] ""
#: src/Content/Widget.php:506
#: src/Content/Widget.php:510
msgid "Archives"
msgstr ""
#: src/Content/Widget.php:530
#: src/Content/Widget.php:518
msgid "On this date"
msgstr ""
#: src/Content/Widget.php:537
msgid "Persons"
msgstr ""
#: src/Content/Widget.php:531
#: src/Content/Widget.php:538
msgid "Organisations"
msgstr ""
#: src/Content/Widget.php:532 src/Model/Contact.php:1651
#: src/Content/Widget.php:539 src/Model/Contact.php:1651
msgid "News"
msgstr ""
#: src/Content/Widget.php:536 src/Module/Settings/Account.php:453
#: src/Content/Widget.php:543 src/Module/Settings/Account.php:453
msgid "Account Types"
msgstr ""
#: src/Content/Widget.php:537 src/Module/Moderation/BaseUsers.php:69
#: src/Content/Widget.php:544 src/Module/Moderation/BaseUsers.php:69
msgid "All"
msgstr ""

View file

@ -31,10 +31,16 @@ function showHideDates() {
</li>
<li id="posted-date-selector-{{$y}}" class="tool posted-date-selector-months" style="display: none;">
<ul class="datebrowse-ul">
{{if $y|cat:$thisday >= $cutoffday}}
<li class="tool">
<a class="datebrowse-link" href="{{$url}}/{{$y|cat:$thisday}}/{{$y|cat:$thisday}}">{{$onthisdate}}</a>
</li>
{{/if}}
{{foreach $arr as $d}}
<li class="tool">
<a class="datebrowse-link" href="{{$url}}/{{$d.1}}/{{$d.2}}">{{$d.0}}</a>
</li>
{{/foreach}}
</ul>
</li>