biocore / biocore/microsetta-interface
Timepicker's valid() is not great
- Dominant language
- Jinja
- Stars
- 1
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
...it allows non-time entries like "asd". If submitted, it triggers a 500 error. One possible option is a try/catch around a call to parse the time based off the events example [here](https://timepicker.co/options/#plugin-events). However, the exact jquery voodoo to update the error label correctly was being elusive, so creating an issue here for now.
```javascript
$('input.timepicker').timepicker({
change: function(time) {
// the input field
var element = $(this), text;
// get access to this Timepicker instance
var timepicker = element.timepicker();
try {
timepicker.format(time);
catch (e) {
// find the error label and update it
}
}
});
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing submission of the invalid value "asd" and inspect the timepicker change callback and error-label handling described in the issue. Done means non-time entries are rejected or reported through the form instead of causing a 500 error, with the error label updated correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100