[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Date Time field: the year display by defaut was too way behind
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69f0a02d2dc3a_3818ed5428972@gitlab-sidekiq-low-urgency-cpu-bound-v2-584f6cb8d4-2s4j6.mail> |
Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
84afda8b by Joel Mpunga at 2026-04-28T11:47:41+00:00
[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
- - - - -
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/84afda8b057f3b1a7cea827da5bf92f524c43321
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/84afda8b057f3b1a7cea827da5bf92f524c43321
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