arqex / arqex/react-datetime

timeConstraints not preserved on default time value.

Open
#672 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

### I'm Submitting a ...
[x ] Bug report
[ ] Feature request
[ ] Support request
```

### Steps to Reproduce
- Create a time constraint on hours, restricting the time from min 15 to max 18 with a step of 1.
- Click the time selector with timeFormat as 'hh:mm A'.
- Try the different options and observe that the time is not within 3pm to 6pm.
- Click the AM/PM button
- Observe the time constraints are now working

### Expected Results
I expect the default time to conform to the min timeConstraint bounds and show me 3pm by default instead of 12am.

### Actual Results
The default time is always 12am (00:00:00) regardless of the bounds. Your time constraints are in the PM, so there's also weird behaviour with how the picker resolves itself to the selectors. You have to click AM/PM manually to resolve the issues and get it into the correct bounds.

### Minimal Reproduction of the Problem
https://codepen.io/123spork/pen/MWYezdP

### Other Information (e.g. stacktraces, related issues, suggestions how to fix)
This is not simply a case of setting the default time value manually as I wish to use a placeholder on the input box provided. "Select Date" etc.

The simplest solution would be to utilise the minimum constraints (if they exist) in the default time value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.