131 Posts
root
8 years ago
Topic

Hello,

I think there is a bug in the calendar field, at least, since seblod 3.8.4.

I configured correctly the time zone on Joomla global configuration. In fact this form view was working perfectly before seblod 3.8.4.

I've got a form with a calendar field with format "Y-m-d H:i:s" stored on its datetime type column in the database.

After saving the form, it displays the datetime I wrote plus 2 hours and the database stores the time minus 2 hours. This is 4 hours in all.

In example:

The input value is 18:30:15

The content view shows 20:30:15

The database have 16:30:15 as value


What's wrong? As I said, at first this form was working well, but not since I did the update to Seblod 3.8.4 nor 3.9.0.

I found this topic but I don't understand which is the solution provided

In any case I think something is wrong with this plugin.

Thank you for reading.
Best regards.

Get a Book for SEBLOD
8 years ago
0
Level 1

i have the self problem more then 6 months and more of seblod versions.

i have sends every time seblod support email.

seblod support makes ervery time a patch:
https://www.seblod.com/community/forums/forms-content-types/calender#post41093

now i have joomla 3.6.4 and seblod 3.10.0 and the problem doesnt solved.

how long still?

131 Posts
root
7 years ago
0
Level 1

Hi,

This problem with the calendar field seems persistent. Apart from the previous example, other content type has a calendar field only for get the date (birthday), without time. It's a mysql datetime field with default value 0000-00-00. As far I can see, if my time now is GMT+1 (París), and my Joomla config is ok, the data introduced in the calendar form field will be always stored with its value -1, no matter if it's time or days.

This is the field's configuration:

Calendar config

Every time I put the date, it's stored as one day less in the database. For example, if I put 1980-01-31, the field stores this value in the database: 1980-01-30

One of the best things of Seblod is the power to make your own database structure and app. I think all the functions that are altering the introduced data on the calendar field should be removed (IMHO). Because if we want to export the database table to csv, for example, all the "time" data we get is false.

I also have a call control system made with Seblod, in this case is very important the time of the field, because isn't the same an incoming call at 9 o'clock that an incoming call at 11:00.

Of course in the first example I can not say to the clients "In order to store your birthday properly, introduce your birthday plus one day", and even if this was the case, the content view will display his/her birthdays +1 days, only the database data would be ok.

Any fix will be appreciated.
Congratulations for your app.
Kind regards.


-Adonay

4229 Posts
Kadministrator
7 years ago
2
Level 1

Hi,

there is a pull request to fix this, please test it

https://github.com/Octopoos/SEBLOD/pull/199

You can just download

https://github.com/klas/SEBLOD/raw/3974e5c847d96c8124f09db5efcc4f4601f3d1b2/plugins/cck_field/calendar/calendar.php

and replace plugins/cck_field/calendar/calendar.php with it, the other changed file is not relevant to your problem.

131 Posts
root
7 years ago
0
Level 2

Thank Klas so much for the support.

I will try your fix.

Best regards.

131 Posts
root
7 years ago
0
Level 2

Hi,

I'm sorry but unfortunately for the moment I've only tested the example of my second post in this topic and the problem is still there.

The database stores 1980-01-30 when I select throught the calendar the date 1980-01-31.

The fix does not solve this problem, at least not at all.

4229 Posts
Kadministrator
7 years ago
1
Level 1

What is stored is not relevant, stored values are in UTC timezone, which usually differers from your local time. What matters is what is shown in content and in forms.

131 Posts
root
7 years ago
0
Level 2

Hi!

Well... I think the difference between UTC and GTM +1 are just one hour or so, not one day. In any case I apologize for the confusion because yesterday after applying the patch I deleted Joomla cache but I forgot to delete the browser cache, and maybe due to this it was still not working. Today I tried again and yes! It works! The date stored now on the database is ok, also the date of the form and the content's date.

Only remains me to test the other problem with hours, not dates, the first post. Also the live values now, today and so

Thank you.

Kind regards

-Adonay

4229 Posts
Kadministrator
7 years ago
0
Level 1

Fixed in 3.11

Get a VIP membership