amsul / amsul/pickadate.js

Custom values in time picker

Ouverte
#677 4 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
request todo
Langage dominant
JavaScript
Étoiles
7.6k
Forks
981
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi @amsul - we've just started using your plugin and it's absolutely amazing!

However we've run into a major blocker that appears to be somewhat echoed a lot around the issues section, and that is the Time Picker's interval option.

While it's very useful to limit the values displayed in the picker, the fact that it rounds the default values (the ones passed in `data-value`) to the next allowed one is breaking a lot of functionality.

A basic example - I'm prefilling an input with a time saved in the database as 23:59, but the picker rewrites it as 00:00 - which basically takes away 23h 59' from the date as a whole.

A very quick fix for this (at least for me) would be to allow specific times in the picker, overriding the rule set by the interval. Maybe something like:

``` javascript
$('.timepicker').pickatime({
interval: 30,
extraValues: [
[14, 45],
[23, 59]
]
})
```

Allowing people to choose 23:59 is a core requirement for us, but using `interval: 1` means having to scroll through all the values, which is a big UX problem -- so it's a big blocker for us.

Maybe you have a workaround for this?

Many thanks!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.