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

"Joel Mpunga \(@joelmpunga79\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69f21ae9b9919_38d6dc60253f1@gitlab-sidekiq-low-urgency-cpu-bound-v2-d59f77678-l6rjc.mail>

Joel Mpunga pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
9747283e by Joel Mpunga at 2026-04-29T14:42:06+00:00
[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
---
* [FIX] Date Time field: the year display by defaut was too way behind

See merge request tikiwiki/tiki!10026


(cherry picked from commit 84afda8b057f3b1a7cea827da5bf92f524c43321)

ea275f72 [FIX] Date Time field: the year display by defaut was too way behind

Co-authored-by: Joel Mpunga <[email protected]>

See merge request tikiwiki/tiki!10102

- - - - -


1 changed file:

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


Changes:

=====================================
lib/core/Tracker/Field/DateTime.php
=====================================
@@ -147,7 +147,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();
 
@@ -160,7 +161,10 @@ class Tracker_Field_DateTime extends \Tracker\Field\AbstractItemField implements
                     $data['error'] = 'y';
                 }
             }
-            $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/9747283e3a040775abf1e7f4b36001ddfd275c6e

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9747283e3a040775abf1e7f4b36001ddfd275c6e
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.