Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar Today: Items wrongly set to pending #17823

Merged
merged 1 commit into from
Sep 25, 2017
Merged

Calendar Today: Items wrongly set to pending #17823

merged 1 commit into from
Sep 25, 2017

Conversation

dgrammatiko
Copy link
Contributor

@dgrammatiko dgrammatiko commented Sep 1, 2017

Pull Request for Issue #17770 .

Summary of Changes

@infograf768 i think 3.x has some extra code for the user_utc compared to 2.x.
I think it's these lines:

$this->value = strftime($this->format, strtotime($this->value));
date_default_timezone_set($tz);

We always read the input as UTC and convert it to server or user but the user submitted the date with their local timezone (most of the times the browser will have the timezone to the area that the user is living). There is the inconsistency...

this should run only when the code is coming from the db, for the data that comes from a form input we need to convert it to UTC. That will fix the problem

Testing Instructions

check #17770

Expected result

Dates are set correctly

Actual result

Dates are set correctly

Documentation Changes Required

No

@infograf768
Copy link
Member

I have tested this item ✅ successfully on 3f3d1a5

Great!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

@infograf768
Copy link
Member

The screenshot in #17770 explains how to test.
Basically, clear the start publishing date for an item, then close the calendar popup, then open the popup again and click on Today.
then look its status in the manager.

This is an old bug that been there for ever.
It is very rare to change the start publishing date to Today as it is set such by default when creating a new item. But it is not rare to set a Start Publishing date in the future, thus not remarking the error.

Someone may not remark the bug when the local computer time zone is set to UTC or UTC-#

Anyone will experience the bug when the local computer is set to UTC+#

@alikon
Copy link
Contributor

alikon commented Sep 4, 2017

I have tested this item ✅ successfully on 3f3d1a5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

@infograf768
Copy link
Member

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

@joomla-cms-bot joomla-cms-bot added RTC This Pull Request is Ready To Commit and removed RTC This Pull Request is Ready To Commit labels Sep 4, 2017
@ghost
Copy link

ghost commented Sep 4, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 4, 2017
@infograf768 infograf768 added this to the Joomla 3.8.0 milestone Sep 4, 2017
@Bakual
Copy link
Contributor

Bakual commented Sep 16, 2017

Actually, I think this issue is not a code issue. It happens because of a wrong user setting. For the calendar (and other date processing) and its UTC conversion to work properly, the user timezone obviously needs to be set to the timezone of the user. Otherwise the server will not know how to convert the datetime properly and it will off by some hours.

In my testing, I only could reproduce the issue when I had set my user timezone to a different than my real timezone "Zurich". Eg setting it to "New York" will produce the effect in my case because I input my local time but the server will interpret it as the time in New York and thus it will be 6 hours "later".

@mbabker mbabker removed this from the Joomla 3.8.0 milestone Sep 19, 2017
@brianteeman brianteeman added this to the Joomla 3.8.1 milestone Sep 19, 2017
@mbabker mbabker merged commit 7aab6df into joomla:staging Sep 25, 2017
@joomla-cms-bot joomla-cms-bot added PR-staging and removed RTC This Pull Request is Ready To Commit labels Sep 25, 2017
mbabker added a commit that referenced this pull request Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants