? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
9 Aug 2015

Issue

As explained in #7657 we have an issue with the date of birth being shown as the wrong day if the timezone of the server is set to a positive value (eg Moscow).

Background

Joomla always stores the dates in UTC and calculates them back when showing. Meaning when you set your server timezone to Moscow, it will subtract 3 hours from the date when saving, storing it as the day before at 9pm. When showing again, it should add those three hours again which brings us back to the day we saved.

Solution

This PR fixes the part when showing the date and applies the correct timezone there. Currently the value is just shown as it was stored in the database.
As an additional advantage we can now specify the format of the date, which usually for date of births is only the date part. Usually nobody is interested in the actual time of birth. :smile:

Testing

Test with entering the date of birth while the timezone is on a positive or on a negative timezone. Both should work. Also test with changing the user timezone, that one should have no impact at all.
You will probably notice that the date of birth may change when you change the server timezone. That is expected as all already stored values will be wrong if you change the server timezone after the data is saved.

avatar Bakual Bakual - open - 9 Aug 2015
avatar Bakual Bakual - change - 9 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Aug 2015
Labels Added: ?
avatar infograf768
infograf768 - comment - 9 Aug 2015

2 remarks:
1. If the server time zone is changed, contrary to #7657, the dob may change. Although it is to be expected for all usual items and has little impact there, in that case it is rather weird.
2. You use 2 different formats when rendering the date: DATE_FORMAT_LC4 and DATE_FORMAT_LC1

avatar Bakual
Bakual - comment - 9 Aug 2015

If the server time zone is changed, contrary to #7657, the dob may change. Although it is to be expected for all usual items and has little impact there, in that case it is rather weird.

Yes, if someone changes the server timezone after a date has been saved, it may change. I wrote that in the PR already and it is expected behavior.
Btw: your PR would change the date likely for all as well, since you basically change the timezone to UTC for all installs.

You use 2 different formats when rendering the date: DATE_FORMAT_LC4 and DATE_FORMAT_LC1

I do, yes. In the profile one I used the same format that is used for other calendar fields. I think it makes sense to be consistent.
For the contact one I used the one you have chosen in your PR.

avatar zero-24 zero-24 - change - 9 Aug 2015
Category Components Front End Plugins
avatar zero-24 zero-24 - change - 9 Aug 2015
Easy No Yes
avatar infograf768
infograf768 - comment - 10 Aug 2015

OK here.

avatar Kubik-Rubik Kubik-Rubik - change - 10 Aug 2015
Milestone Added:
avatar Kubik-Rubik Kubik-Rubik - alter_testresult - 10 Aug 2015 - infograf768: Tested successfully
avatar Kubik-Rubik Kubik-Rubik - test_item - 10 Aug 2015 - Tested successfully
avatar Kubik-Rubik Kubik-Rubik - change - 10 Aug 2015
Status Pending Ready to Commit
avatar fontanil
fontanil - comment - 24 Aug 2015

@test:
Patch is OK for me. Thanks!

avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2015
Labels Added: ?
avatar infograf768 infograf768 - alter_testresult - 24 Aug 2015 - fontanil: Tested successfully
avatar Kubik-Rubik
Kubik-Rubik - comment - 24 Aug 2015

Thank you @Bakual!

avatar Kubik-Rubik Kubik-Rubik - reference | d46bfcd - 24 Aug 15
avatar Kubik-Rubik Kubik-Rubik - merge - 24 Aug 2015
avatar Kubik-Rubik Kubik-Rubik - close - 24 Aug 2015
avatar Kubik-Rubik Kubik-Rubik - change - 24 Aug 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-08-24 08:15:42
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 24 Aug 2015
avatar joomla-cms-bot joomla-cms-bot - close - 24 Aug 2015
avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2015
Labels Removed: ?
avatar Bakual Bakual - head_ref_deleted - 24 Aug 2015

Add a Comment

Login with GitHub to post a comment