question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Min value is displayed as active, but cannot be selected when clicked

See original GitHub issue

Hi there,

I’m facing an issue with the calendar: while my min date is set and it’s displayed as selectable, I actually can’t select it when I click on it, but I can select the max value, ironically.

I’m setting values like this in the TS file:

@Input() beginDate= new Date('2019-05-16');
@Input() endDate =new Date('2019-06-15');
@Input() selectedDate= new Date('2019-05-18');

And this is what i write in the component template:

<input [owlDateTimeTrigger]="dt1" [owlDateTime]="dt1" [min]="beginDate" [max]="endDate" [value]="selectedDate">
<owl-date-time [pickerType]="'calendar'" #dt1></owl-date-time>

Can anybody bring any light on this? Thanks in advance!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

2reactions
jaco-terbraakcommented, Sep 27, 2019

I’ve found a workaround: Make sure to set the min to midnight in local time, including milliseconds. So to set the minimum date to tomorrow, do it like this: minDate = moment().add(1, 'd').set({hours: 0, minutes: 0, seconds: 0, milliseconds: 0});

This way the date compare function won’t get confused, and selecting the min date will work.

1reaction
ayazdinkcommented, Aug 16, 2019

You need to set the min to current date with 0 hour, 0 minute and 0 second

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML number input min and max not working properly
When I change the time in the rendered UI using the little arrows on the right-hand side of the input field, everything works...
Read more >
HTML5 Forms: Min, Max, Step Type Attribute - Wufoo
To use the min, max, and step attributes the input first needs a type of number, range or one of the date/time values....
Read more >
<input>: The Input (Form Input) element - HTML
Displays as a range widget defaulting to the middle value. Used in conjunction min and max to define the range of acceptable values....
Read more >
Edit Menu - ImageJ
Alt-click in the Image>Colors>Color Picker window to change the background color. With stacks, a dialog is displayed offering the option to clear the...
Read more >
How to use the forms controls on a worksheet in Excel
Click Popular, select the Show Developertab in the Ribbon check box, and ... Note: The INDEX() formula uses the value in G1 to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found