[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Date Time field: the year display by defaut was too way behind

"Jean-Marc Kadimba \(@jmkadimba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a8851d06484d_3918cec87379c@gitlab-sidekiq-low-urgency-cpu-bound-v2-568cbc9b4f-srt2f.mail>

Jean-Marc Kadimba pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
51dbbba7 by Jean-Marc Kadimba at 2026-08-21T15:18:07+02:00
[BP][FIX] Date Time field: the year display by defaut was too way behind
---
* [BP][FIX] Date Time field: the year display by defaut was too way behind
---
* [FIX] Date Time field: the year display by defaut was too way behind

See merge request tikiwiki/tiki!10026

See merge request tikiwiki/tiki!10102

See merge request tikiwiki/tiki!11029

- - - - -


1 changed file:

- lib/core/Tracker/Field/DateTime.php


Changes:

=====================================
lib/core/Tracker/Field/DateTime.php
=====================================
@@ -110,7 +110,8 @@ class Tracker_Field_DateTime extends \Tracker\Field\AbstractItemField implements
             }
         } else {
             // This condition addresses the scenario where data is received from the API, and the timestamp value is provided in its raw form.
-            $value = (isset($requestData[$ins_id]) && ! empty($requestData[$ins_id]))
+            $hasRawRequestValue = array_key_exists($ins_id, $requestData);
+            $value = $hasRawRequestValue
                 ? $requestData[$ins_id]
                 : $this->getValue();
 
@@ -130,7 +131,10 @@ class Tracker_Field_DateTime extends \Tracker\Field\AbstractItemField implements
                 }
             }
 
-            $data['value'] = $value;
+            // Keep default current date initialized above on initial render (no submitted value and no stored value).
+            if ($hasRawRequestValue || ! empty($value)) {
+                $data['value'] = $value;
+            }
         }
 
         return $data;



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/51dbbba73d2e2afabe0051b2728ceac16acb40a9

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/51dbbba73d2e2afabe0051b2728ceac16acb40a9
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.