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

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


Commits:
a98e0542 by Victor Emanouilov at 2026-06-24T11:36:07+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
=====================================
@@ -144,8 +144,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/a98e05422c412cc7ea2789b09ed07d057dfb633b

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