ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Time range not working in IE #142

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello,

I'm having some issues with the input range selecting the time with ng2-date-time-picker. It works just fine with any browsers but Internet Explorer. I'm using IE11 for this test. Check my code here:

       <div class="input-group">
            <i class="fa fa-calendar fa-2x"></i> 
           <input placeholder="(start date)"
                class="form-control pull-left" 
                [(ngModel)]="selectedDate1" 
                ng2-datetime-picker 
                date-format="DD-MM-YYYY HH:mm" 
                close-on-select="false"
                [min-date]="limitDates.minDate" 
                [max-date]="limitDates.maxDate"
            />
        </div>

What do you think is the problem? According to the specs of the input rage, it's supported by IE10.

http://www.html5tutorial.info/html5-range.php

Thanks for your help.

allenhwkim commented 7 years ago

I am afraid that the limiDates.minDate(maxDate) is not working for IE11. IE11 does not do date parsing like other browsers do. Please provide full example with a plunker as told at ISSUE_TEMPLATE.md. My GUESS is that you do not use momentjs, and you do provided string as minDate/maxDate. It's just a GUESS.

ghost commented 7 years ago

Hi, @allenhwkim, thanks for reaching out. I replicated it but it seems that with the last version of the code, it works. I will leave this anyway, in case somebody encounters the same problem. I was using 0.13.0:

I actually use moment.js and as I said, everything works fine in both Chrome and Firefox. There's no message error/warning in the console either.

About the [min-date] or [max-date], I use an object declared as local variable with both default values. It's not exactly like you wrote in your comment (there's no such "limitDates.minDate(maxDate)" function).

I created a plunker replicating this that uses the latest version of date-picker and works fine: https://plnkr.co/edit/QfeHuSmWfbh5NalcvolO?p=preview

If I have more problems, I will create a new issue or re-open this one if it's strictly related. Thanks!