?
avatar roland-d
roland-d
12 Sep 2018

Steps to reproduce the issue

Create a form using the calender field like this:

<field name="end"
			   type="calendar"
			   label="COM_TIME_SLOTS_END"
			   format="%H:%M"
			   showtime="true"
			   translateformat="false"
			   timeformat="24"
			   singleheader="false"
			   todaybutton="false"
			   filltable="false"
			   minyear="0"
			   maxyear="0"
		/>

Notice that the format is set to %H:%M because I only want hours and minutes.

Save the form with the set time and then load the form again. You will see that the time in the input field is set to the current time and not the time stored earlier.

The input does have the correct value as you can see in the value and date-alt-value field:
image

Expected result

Time is shown as stored

Actual result

Current local time is shown.

System information (as much as possible)

Joomla | 3.8.12
Database Type | mysql
Database Version | 5.6.37-82.2-log
Database Collation | utf8_general_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 7.2.9
Web Server | Apache/2.4.34 (Unix) PHP/7.2.9

Additional comments

avatar roland-d roland-d - open - 12 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - change - 12 Sep 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Sep 2018
avatar brianteeman
brianteeman - comment - 12 Sep 2018

I may be confused but there is an attribute user_utc which if i remember correctly is related to this

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Sep 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Sep 2018
Category Fields JavaScript
avatar mbabker
mbabker - comment - 12 Sep 2018

Now I have to ask the obvious question. What is being gained by using the calendar field (which my mind always associates with dates, as in a datepicker, as in a date input type) to set a timestamp versus either using the native time input type or some kind of JavaScript enhancement of a time selector?

avatar roland-d
roland-d - comment - 12 Sep 2018

@brianteeman I tried that as well but it still uses the wrong time.

@mbabker The not so obvious answer is that I did not know about the Time field until after reporting this. Although Joomla doesn't support this Time field. That is why we created issue #22140

Now I am using a text field with a pattern, that does the job for now. Regardless of that, I am still convinced this is a bug. Whether it should be solved is the next question. Feel free to close the issue.

avatar mbabker
mbabker - comment - 12 Sep 2018

Well if the calendar field is supposed to work as a date/time selector or only a date selector or only a time selector, then it probably is a bug if it can't work as a time selector only.

avatar Bakual
Bakual - comment - 12 Sep 2018

I don't think it ever worked as a time-only selector. And imho it isn't supposed to work like that.
It's either date-only or date/time.
It's certainly better to add a "time" input field which works with the HTML5 time input field.

avatar roland-d
roland-d - comment - 12 Sep 2018

Closing as expected behavior.

avatar roland-d roland-d - change - 12 Sep 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-09-12 15:23:58
Closed_By roland-d
avatar roland-d roland-d - close - 12 Sep 2018

Add a Comment

Login with GitHub to post a comment