amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Pickatime does not always handle decimal minimum time #1245

Open alex-stanescu opened 1 year ago

alex-stanescu commented 1 year ago

Using Chrome 108.0.5359.124 (Official Build) (x86_64) on MacOS, latest stable DatePicker (v3.6.4)

Certain decimal minimum times are not handled by pickatime correctly, resulting in greyed out values in the picker and an invalid time in the input.

Minimal repro, given some jquery input element ip:

ip.pickatime({ container: 'html', interval: 5, format: 'h:i A' })
ip.pickatime('picker').set({ min: [16, 40.5], max: false })
ip.pickatime('picker').set('select', [14, 14])

This results in "2:45.5 PM" in the input and a ton of invalid dates in the picker when it opens

image

This does not happen with other minimums, such as [17, 40.00000000000007], which correctly fills the input with 5:40 PM and the picker with options starting at the same time

image

This was originally observed using just a decimal hours (specifically, [16.666666666666668, 0]), so it can appear in that fashion as well.