jQuery-Timepicker-Addon icon indicating copy to clipboard operation
jQuery-Timepicker-Addon copied to clipboard

Time format is invalid

Open poliaca opened this issue 9 years ago • 3 comments
trafficstars

"Hours" which is specified in property of defaultValue is ignored and returns "0" when he clicks a component and a calendar is displayed, on condition that timeFormat property is only "Hours". (These errors are described with sample codes : "6 o'clock" can be displayed on calendar, but "0 o'clock" is on the screen. )

If these symptoms are bugs, would you correct them? If not, please show me a solution.

The following is the sample code : $('#xxx').datetimepicker({ dateFormat: 'y/mm', timeFormat: 'HH', defaultValue: '2016/11/08 06:07:08', controlType: 'select' });

poliaca avatar Nov 14 '16 01:11 poliaca

This is maybe too late but I did the same mistake. To get it work don't use the dateFormat AND timeFormat properties at the same time, choose one of them.

ChristophKnopf avatar Mar 02 '17 20:03 ChristophKnopf

It is meaningless if only one of them can be set. Is this a bug?

poliaca avatar Mar 03 '17 01:03 poliaca

I was wrong, you can configure dateFormat and timeFormat properties the same time. Sorry for that. I tested you example and it works fine for me, I can choose every hour and it is correctly displayed on the screen. Do you have another example for me to help you?

Edit: I think I understand your problem now. You are expecting the hours to be 6 already when the datimepicker opens, right? But it is '00' ( I am using local and 24 time format, so for me its 00).

ChristophKnopf avatar Mar 04 '17 17:03 ChristophKnopf