[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] date field timezone offset issue when timestamp is a string

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a3b9714ec411_3828ecc84420b8@gitlab-sidekiq-low-urgency-cpu-bound-v2-749c764f6d-9fkww.mail>

Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
2aef2ec8 by Victor Emanouilov at 2026-06-24T11:36:25+03:00
[FIX] date field timezone offset issue when timestamp is a string

- - - - -


1 changed file:

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


Changes:

=====================================
lib/core/Tracker/Field/DateTime.php
=====================================
@@ -169,8 +169,13 @@ class Tracker_Field_DateTime extends \Tracker\Field\AbstractItemField implements
 
         if ($value) {
             if ($this->getOption('datetime') === 'd') {
-                // offset the UTC-stored timestamp of the date by current display timezone, so we actually display the correct date entered by user
-                $value -= TikiDate::tzServerOffset(TikiLib::lib('tiki')->get_display_timezone(), $value);
+                if (is_string($value) && is_numeric($value)) {
+                    $value = intval($value);
+                }
+                if (is_numeric($value)) {
+                    // offset the UTC-stored timestamp of the date by current display timezone, so we actually display the correct date entered by user
+                    $value -= TikiDate::tzServerOffset(TikiLib::lib('tiki')->get_display_timezone(), $value);
+                }
             }
             if (isset($context['list_mode']) && $context['list_mode'] == 'csv') {
                 if ($this->getOption('datetime') == 'd') {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2aef2ec85174f176beaecd8c9d633e653ed90b1c

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