I got a problem i'm currently trying to use daterangetimepicker from http://www.daterangepicker.com/ to select date for stuff. Problem is that when i select a date using it my ng-model is updated only once and then it's not triggered anymore and it's not updating except if input manually the date in the input box.

In HTML :

<span>{{event.startDate}}</span>
<input style="display:inline-block; width:auto;" type="text" class="form-control inper dateBox" id="dateEventStart" placeholder="Date de début" min="01/01/2018" ng-change="changeDate()" ng-model="event.startDate"/>

In Controller :

  $('#dateEventStart').daterangepicker({
     opens: "center",
     autoApply: true,
     singleDatePicker: true,
     startDate: $scope.event.startDate,
     locale: {
        format: 'DD/MM/YYYY',
        daysOfWeek: [
           "Di",
           "Lu",
           "Ma",
           "Me",
           "Je",
           "Ve",
           "Sa"
           ],
        monthNames : [
           "Janvier",
           "Février",
           "Mars",
           "Avril",
           "Mai",
           "Juin",
           "Juillet",
           "Aout",
           "Septembre",
           "Octobre",
           "Novembre",
           "Décembre"
        ],
     }       
  }, function(start, end, label) {
     $scope.event.startDate = start
  });

My span isn't updating everytime i use the daterangepicker and i don't know why but it does if i change the date manually. Any idea ?

0

There are 0 best solutions below