0

I have the following Input with Kendo Date picker:

<input kendo-date-picker
                     k-options="monthSelectorOptions"
                     ng-model="milestone.estimate"
                     ng-change="changeIt(milestone.estimate)"
                      />

I would like to convert and change only model value which is pointing to the actual used date picker (is it table with many date pickers).

I tried to do using Kendo config and events for date picker:

// SET OPTIONS FOR DATE TIME PICKER
  $scope.monthSelectorOptions = {
    format: "dd.MM.yyyy",
    change: function(data) {
      console.log(data);
      console.log("Change");
      this.value = "TEST";
      return "TEST";
    },
    close: function(data) {
      console.log(data);
      console.log("Close");
      this.value = "TEST";
      return "TEST";
    }
  };

But without luck.

So i tried ng-change event:

$scope.changeIt = function (data){
    console.log(data);
    return "XXXXXXXXXXXXXXXXXXX";
  };

But with same results.

At the end i tried to use watchCollection :

$rootScope.$watchCollection(
    "milestone.estimate",
    function( newValue, oldValue ) {
      alert("Change")
      console.log(newValue);
      console.log(oldValue);
    }
  );

But with same result.

So i would like to ask, how can i do it in right way please?

Many thanks for any advice.

redrom
  • 11,502
  • 31
  • 157
  • 264

0 Answers0