fragaria / angular-daterangepicker

Angular.js wrapper for dangrossman/bootstrap-daterangepicker
MIT License
519 stars 372 forks source link

$dirty is always false #242

Closed johnico closed 5 years ago

johnico commented 7 years ago

Hi - I am using the range picker example as is in the example site (but removed the range default like "today" )

my problem is that the $dirty is always false and it is makes problem with another inputs

i have submit button that need to listen if there are changes in the date picker or other input and then the $dirty will be true;

how can I fix it ? <input readonly date-range-picker id="daterange3" name="daterange3" class="form-control date-picker" type="text" ng-model="date" options="opts" required/>

cabloo commented 7 years ago

I fixed this using eventHandlers option:

    eventHandlers: {
            'apply.daterangepicker': function (ev, picker) {
              serverForm.form.form['billing.date'].$dirty = true;
            },
    }