This is a migrated thread and some comments may be shown as answers.

TimePicker does not conform to IS0 8601 3.5.2 on Time of Day midnight representations

8 Answers 446 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Tim R
Top achievements
Rank 1
Tim R asked on 21 Jan 2013, 02:53 PM
Typo in title: should be 5.3.2

ISO 8601 5.3.2 distinguishes between combined representations of Date-Time values  (e.g. 2013-01-20 18:00) and uncombined representations of Time of Day values (e.g. 18:00); the latter is not connected to any particular day and because it is not yoked to a date, it is not a moment in a chronological continuum that extends beyond the 24-hours of the single (indeterminate) day. "Time of Day" is a very simple data type, an analog for the hours, minutes, and seconds of the 24-hour clock, which runs from 00:00 to 24:00.

Unlike a combined Date-Time representation, where it is possible to disambiguate the start of the day from the end of the day by incrementing the date element (January 20 at 00:00 is the start of January 20th.  January 21 at 00:00 is the end of January 20th) the uncombined Time of Day representation has to find another way to distinguish the start of the day from the end of the day, as it lacks a date element. To distinguish the start of the 24-hour day from the end of the 24-hour day,  ISO 8601 3.5.2 treats 24:00 as a valid representation of the end of the day. 00:00 refers to the start of the day. 24:00 refers to the end of the day. When the hour value of a Time of Day is 24, the minutes and seconds must be 0.

Examples of the use of 24:00 under ISO 8601 5.3.2 can be found in the original ISO 8601 specification as well as in Appendix B.1.2 Time of Day here: http://dotat.at/tmp/ISO_8601-2004_E.pdf   (cf. page 28).  Here is an excerpt (sorry, the formatting is lost):

Midnight — The beginning of a day 
Basic format............... Extended format .....................Explanation 
000000...................... 00:00:00.................................. Complete 

0000........................... 00:00....................................... Hour and minute only 

Midnight — The end of a day 
Basic format............... Extended format..................... Explanation 
240000....................... 24:00:00................................ Complete 
2400........................... 24:00..................................... Hour and minute only


But the Kendo timePicker does not accept the string literal 24:00:

    var timePicker = $("#myTimePicker").data("kendoTimePicker");
    timePicker.value("24:00");
 
    ?timePicker.value()
     null

The Kendo TimePicker should accept 24:00.   The developer should be able to set 24:00 as the value for the TimePicker and later get 24:00 from it.   The DateTimePicker can be used for working with combined representations   The TimePicker should be usable with uncombined Time of Day representations.

As an aside, I believe it is unwarranted to treat an uncombined Time of Day as if it were a moment on the calendar continuum. It does not achieve the existential status of calendar-time until it is explicitly yoked to a date.   The problem arises from trying to make the Time of Day be more than the crude but very useful datatype it is.  

Not all databases conform to this ISO standard. Here is one that does:
http://www.postgresql.org/docs/9.1/static/datatype-datetime.html

and here is another:
http://www.sqlite.org/lang_datefunc.html

and here is another:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.intro%2Fsrc%2Ftpc%2Fdb2z_datetimetimestamp.htm


P.S.  The following are all different datatypes under ISO 8601 and ought not be confused with one another, as they are indeed being conflated by many, including the folks at  java.SQL.lang who are conflating TimeSpan and TimeOfDay into a single datatype, muddying the water.  

DateTime
TimeSpan aka Interval
Time aka TimeOfDay

Only the first, DateTime, is linked to a particular date on the calendar. TimeSpan and TimeOfDay are not on the calendar  nor are they in a time-zone, having no localization information. If a Time is cast to a DateTime, the cast should either fail or a default/arbitrary date such as the beginning of the epoch might be chosen. But strictly speaking qua datatypes, TimeSpan and TimeOfDay are unrelated to the calendar.


8 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 Jan 2013, 11:58 AM
Hello Tim,

 
The TimePicker / DateTimePicker widget works with Date object. As you probably noticed, the Date object supports hours value between 0 and 23. Because the Date object cannot represet "24" as hour value then TimePicker / DateTimePicker will not be able to accept it too.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
1
Tim R
Top achievements
Rank 1
answered on 23 Jan 2013, 01:06 PM
Does Kendo have any intention of offering an ISOTimePicker that works with the uncombined Time type as defined in ISO 8601 3.5.2 ?
 00:00 to 24:00 without time zone and the variant form: 00:00 to 24:00 with time zone.  

Our applications need to work with time-of-day, not only date-times.  I hope an ISOTimePicker is on the horizon.

I don't have any more Request a Feature points left, BTW, or I would ask for this.

0
Georgi Krustev
Telerik team
answered on 23 Jan 2013, 01:41 PM
Hello Tim,

 
Our roadmap for Q1 2013 is set in stone. I will log your your request in our system. If other users require such widget we will schedule it for further investigation.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
1
Lauri
Top achievements
Rank 1
answered on 28 Jan 2013, 06:23 PM
+1 to this request.

Although programmatically 0-23 makes sense it is difficult to understand by end-users.

When people want to define a time period within a single day it makes more sense for them to use two timepickers with values 20:00 - 24:00 than 20:00 - 00:00. 

The latter way makes more sense with datetimepickers e.g. 01/01/2013 20:00 to 02/01/2013 00:00 but this is not always a good solution from UX viewpoint as why to show date information when this cannot be changed.
0
Georgi Krustev
Telerik team
answered on 30 Jan 2013, 08:23 AM
Hello Sven,

 
I will suggest you open a uservoice item on the same subject. Thus more people can cast their vote for this functionality.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
1
Tim R
Top achievements
Rank 1
answered on 05 Feb 2013, 03:12 PM
Another factoid for the record:

?(new Date('1995-02-04T24:00').getTime() == new Date('1995-02-05T00:00').getTime());  
true

Visual Studio immediate window, javascript debugger.
Following ECMAScript 2011 Standards  

"As every day both starts and ends with midnight, the two notations  00:00 and  24:00 are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time: 1995-02-04T24:00 and 1995-02-05T00:00"  (page 169, Note #1)

P.S. February 4th is my daughter's birthday, so I will interpret the example from ECMA org as a good omen that in the future Kendo will offer a 24-hour TimePicker.  :-)
0
Georgi Krustev
Telerik team
answered on 06 Feb 2013, 10:20 AM
Hello Tim,

 
Chrome brower returns "invalid date" for this new Date('1995-02-04T24:00'). As I pointed the TimePicker uses Date object and until the aforementioned value is not supported in all major browsers we cannot do much.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
1
Tim R
Top achievements
Rank 1
answered on 06 Feb 2013, 01:02 PM
I've just submitted bug reports to Chrome and Safari on this behavior.    FF, Opera, and IE9 do conform to the ECMA standard.
Tags
Date/Time Pickers
Asked by
Tim R
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Tim R
Top achievements
Rank 1
Lauri
Top achievements
Rank 1
Share this question
or