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

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


Commits:
68ed9e87 by Victor Emanouilov at 2026-06-24T11:35:59+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/68ed9e87bbbee7777456f9569bc17d41519b583e

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