akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

Datetimepicker min max values #2545

Open charllie opened 4 years ago

charllie commented 4 years ago

Issue type

I'm submitting a ...

Issue description

2 datetimepickers:

Current behavior:

Second datetimepicker sets minimum datetime to next day (except when 0:00)

Expected behavior:

Same day should be selectable (maybe set minimum in time picker)

veronicadev commented 4 years ago

@charllie can you provide the code you're using? thanks

charllie commented 4 years ago

@veronicadev Thanks for your reply. Sure, you can find below my code. I used date-fns providers.

<input nbInput fullWidth [nbDatepicker]="startPicker" [ngModel]="startDate" />
<nb-date-timepicker #startPicker format="PPP p" [max]="endDate" [step]="10" singleColumn>
</nb-date-timepicker>

<input nbInput fullWidth [nbDatepicker]="endPicker" [ngModel]="endDate" twelveHoursFormat />
<nb-date-timepicker #endPicker format="PPP p" [min]="startDate" [step]="10" singleColumn></nb-date-timepicker>

For instance, I picked in start date October 10th, 2020 12:10 AM but I can't pick October 10th in end date.

ichigo92 commented 3 years ago

@charllie were you able to solve this?

I have start date time and end date time, I want the user to be able to select the same date but the time should not be before the time selected in the start date time.

charllie commented 3 years ago

hi @ichigo92, unfortunately I haven't investigated further. If I have time and if I find a solution, I will comment.

pishangujeniya commented 3 years ago

Me too facing this issue 😕, not able to select the date and time range in a single day, For Example, Once a minimum date & time are selected, then another date should be more than the minimum date instead of the same date but more than the minimum time.