greatCodeIdeas / md-date-range-picker

Angular Material Date Range Picker Service/Directive
MIT License
62 stars 40 forks source link

Infinity loading when I add first-day-of-week arg #56

Open SiriusED opened 6 years ago

SiriusED commented 6 years ago

When I add first-day-of-week="0" or first-day-of-week="1" I get infinity loading on my page. Here is the part of my HTML with datepicker:

                <div flex="100">
                    <md-date-range auto-confirm="true"
                                   first-day-of-week="0"
                                   show-template="false"
                                   one-panel="true"
                                   placeholder="{{ 'stages.DATE' | translate }}"
                                   format="stageCtrl.formatDate"
                                   md-on-select="stageCtrl.updateDateFilter()">
                    </md-date-range>
                </div>

And it works normally if I don't add this argument, like this code:

                <div flex="100">
                    <md-date-range auto-confirm="true"
                                   show-template="false"
                                   one-panel="true"
                                   placeholder="{{ 'stages.DATE' | translate }}"
                                   format="stageCtrl.formatDate"
                                   md-on-select="stageCtrl.updateDateFilter()">
                    </md-date-range>
                </div>

And one more question how to switch on "Clear" button inside of Datepicker? And if there any event or ay I can get after I press "Clear" button to update my data on the page?

roelbarreto commented 6 years ago

For clear event, you can watch for the model changes, if !startDate or !selectedTemplateName then its cleared. I'll investigate the infinite

brianrodecap commented 5 years ago

I am also experiencing this issue. Infinite loop using "first-day-of-week" on "md-date-range."

roelbarreto commented 5 years ago

Can you provide a jsfiddle to reproduce this? I'm getting hard time to reproduce it and look for the exact error.

jktu2870 commented 5 years ago

@ipiz Hi! I've made a fix for this issue. Please check it out.