[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <6a3b96e9ca226_3849337049833@gitlab-sidekiq-low-urgency-cpu-bound-v2-749c764f6d-6sqhs.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
da518914 by Victor Emanouilov at 2026-06-24T11:35:48+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
=====================================
@@ -207,8 +207,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/da51891400db75ff6c9e27fd259d6f50f56b3a87

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