]> git.mxchange.org Git - friendica.git/commitdiff
[frio] On this date option in the archives
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 6 Jun 2023 12:41:16 +0000 (08:41 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 6 Jun 2023 12:42:34 +0000 (08:42 -0400)
src/Content/Widget.php
view/lang/C/messages.po
view/templates/widget/posted_date.tpl

index ae3a950132dcf078436bb3710672b7db6f7e0b23..6b44a62eb7dbe9bb6cbdae91665e57c11b3e8f49 100644 (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;
index 3388f43bb72d132491e195b759fe6ff20246e323..7ec266268bb0c5478635a3ec86e9e79b0c75bcae 100644 (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 ""
 
index ad40bcb0223c22aae028ca1e3fcf2824968b5289..a488cc80657aab6d3d34a5fb9fa92f56bd3485a5 100644 (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>