timepicker icon indicating copy to clipboard operation
timepicker copied to clipboard

timepicker breaks if range crosses meridiem from PM to AM

Open designosis opened this issue 8 years ago • 2 comments

See jsfidde here.

The following ...

	$('#time2').timepicker({
		zindex: 9999,
		timeFormat: 'h:mm p',
		interval: 15,
		startTime: 	 '11pm',
		minTime: 	 '11pm',
		maxTime: 	 '1:00am',
		defaultTime:	'11:30pm',
		dynamic: false,
		dropdown: true,
		scrollbar: true
	});

... doesn't work. If you switch am with pm, not crossing the 24:00 hour mark, it does work.

designosis avatar Feb 20 '17 12:02 designosis

I have this exact issue too. I want to make the minTime and maxTime dynamic based on the user's timezone but this can result in a range like 12:30pm - 3am, triggering this problem.

ptrin avatar Jan 26 '21 21:01 ptrin

Despite my commit message above, my change only fixes this issue for the case where the dropdown is not used (we don't use it).

ptrin avatar Jan 27 '21 13:01 ptrin