When editing a user profile the date is always off by one day. For example if I enter 2/2/1980 as my birthday the saved value will be 2/1/1980.
Here is a video of it happening:
www.youtube.com/watch?v=PpuuccVjhKY&feature=youtu.be
I have also seen reports of this happening for other JomSocial websites. This is happening for all of my users so it is not just my machine.
I tried this fix:
www.jomsocial.com/blog/3-1-0-2-hot-fix-and-bugs-that-are-not
And changed the date format to $html .= "dateFormat: 'yy/mm/dd',n";
This partially worked, as the date started saving correctly, but for some reason now the input field when editing the profile field is empty. The HTML has the correct date, but this date is not appearing, either as text in the input field, or as the default value when using the calender popup:
<input type="text" id="datePickerField3" size="10" class="required jomNameTips tipRight input-medium hasDatepicker" value="2014-06-30" style="width:auto; cursor:pointer; color: #000;" readonly="" original-title="Enter your date of birth so other users can know when to wish you happy birthday ">
I've checked the database and it is saving the incorrect value. For example, 6-20-2014 will save as '2014-6-19 23:59:59'
Is this possibly a server configuration issue? I'm unable to find out exactly where this date change is happening. It does seem to be related to the date format, but I'm not sure how to fix that without creating other issues.
Thanks for any help.
PLEASE DO NOT UPDATE ANYTHING. There are customizations that will get broken and this is a live site.
Hi Elliott,
THis is old issue, which should work fine in version 3.2.0.5, may I know what is your Jomsocial version? I cant acces your backend so I cant check it by myself.
thank you
I updated to version 3.2.0.5 and am still having the same problem. Your Joomla access should now work.
Please let me know what I can do to fix this. It is still effecting all users on the system, both front end and back end when using Jom Social.
Thanks
Hi Elliott,
Ok good and you need to re-save the profile for fixing this..
If you still have the problem please let me know, and anyway the backend account is not working for me, can you verify it please?
thank you
Hi Elliot,
You can edit this original topic
www.jomsocial.com/index.php?option=com_k...id=17313&mesid=88041
and provide the info inside private info.
Thank you
He Elliot,
I just check this issue again on your site and seems everything is working fine in my end.. look at my video here
screencast.com/t/wQb9HRQfg
thank you and have a nice day!
I think we already established that this problem is only effecting people in certain time zones. Yes, it works for you, but in North America we are still having this problem. Here is a video of the problem:
www.youtube.com/watch?v=-1JWwnVZre0&feature=youtu.be
So ... any ideas what is causing this? Or could you at least point me in the right direction so that I can look into it myself>
Hi Elliot,
I have just gone to the user that you showed in your video as well as the test one and cannot replicate the issue. I'm not saying there isn't an issue but the ones i tried (your original video) i cannot replicate the issue.
Could you try this for me please
1. Find a user that has the issue and try this
2. Edit the user in admin and change the birth date to another date
3. save the changes
4. Edit the user and put the birthdate back to what it should be 5
5. Save the changes
Does it now store the correct date or is the problem still there, The reason i ask this is after this bug is fixed any users that had the issue need to save their profile again to fix it at the user level.
If none of this helps them please tell me a few users that have the issue and i will check them
Hi Paul,
Thanks for you help. I actually found a fix which is why it is working now. The fix is below, which may help when developing the next version of the component if it can be integrated.
com_components/libraries/fields/date.php
change lines 155 and 156 to:
$html .= "joms.jQuery(\"#dpField" . $field->id . "day\").val((sDate.getUTCDate()));\n";
$html .= "joms.jQuery(\"#dpField" . $field->id . "month\").val(sDate.getUTCMonth() + 1);\n";
The problem is the JS guys are using the plain getDate() and getMonth() calls, which are not in a predictable timezone. So depending on what timezone those are evaluated for, you might end up with the birthday computations off by a day. Keep everything in UTC and timezone offsets won't back you up by a day.
Hi Elliot,
Thank you very much for updating us with that info, I will make sure that our developers see this information. Most importantly i'm glad your issue is resolved, even if it was by yourself. :)
Have a great day and thanks again
Hi Ellott,
I just wanted to let you know that your code changes have now been added to our release, many thanks for your input. Customer feedback is always apriciated