feat(NcDateTimePicker): add range limit props and inline option#8009
feat(NcDateTimePicker): add range limit props and inline option#8009
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8009 +/- ##
=======================================
Coverage 52.77% 52.77%
=======================================
Files 103 103
Lines 3348 3348
Branches 976 976
=======================================
Hits 1767 1767
Misses 1333 1333
Partials 248 248 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c91528b to
033d753
Compare
|
Thanks a lot for the detailed review @ShGKme! Should be good now |
e344c3a to
b66e274
Compare
|
So for people following along: I made a small change to make the min/max function exactly like the native time picker. With my previous implementation it would apply minTime to every day, so for example you would set minTime to 08:00 and that means that you would not able to select before 08:00 on any given day, now however I made min/max represent a range, so if you set min to 08:00 on Monday and max 18:00 on Wednesday you will be able to select any time in between. |
|
Now I also added support for ranges and |
| minTime: props.min && value.value ? sameDay(props.min, value.value as Date) ? minTime.value : undefined : undefined, | ||
| maxTime: props.max && value.value ? sameDay(props.max, value.value as Date) ? maxTime.value : undefined : undefined, |
There was a problem hiding this comment.
To remove nested ternary operator
| minTime: props.min && value.value ? sameDay(props.min, value.value as Date) ? minTime.value : undefined : undefined, | |
| maxTime: props.max && value.value ? sameDay(props.max, value.value as Date) ? maxTime.value : undefined : undefined, | |
| minTime: props.min && value.value && sameDay(props.min, value.value as Date) ? minTime.value : undefined, | |
| maxTime: props.max && value.value && sameDay(props.max, value.value as Date) ? maxTime.value : undefined, |
There was a problem hiding this comment.
Is it guaranteed that value.value is a Date here?
There was a problem hiding this comment.
It isn't always Date but it should be for the types I am considering
There was a problem hiding this comment.
If it is not always Date here, we cannot use as Date. What happens when it is not Date?
There was a problem hiding this comment.
What I mean is if we are talking about the only time selector then we get a TimeObj, but those as are inside ifs that won't be reached in case of an only time selector
|
Hello all, happy holidays. Just wanted to bump this PR to get the reaming, piece of the migration solved. |
|
Hello all, can we get this PR out of the abyss and in to the light? LOL This is the remaining piece we need for Calendar 6.2 RC |
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
316b520 to
987408e
Compare
We noticed that some properties that we used of the old datepicker in calendar didn't exist in the new one.
☑️ Resolves
🖼️ Screenshots
Added:

🏁 Checklist
stable8for maintained Vue 2 version or not applicable