Closed brunoaduarte closed 9 years ago
Hmmm, ok, that's interesting. Apparently just using {{minDate}}
when minDate = new Date()
outputs the date with quote marks around it...
For now you can fix this by adding a date filter like so: {{minDate | date}}
. I don't think this is a bug with the date-time-picker as such.
Moving forward I've changed the repo as it's not so much "material" (md-
) specific, so going forward any issues should be brought up in https://github.com/SimeonC/sc-date-time.
If my above comment doesn't fix the issue to your satisfaction let me know over there.
Hi @SimeonC , unfortunately it didn't fixed the problem,
attrs.$observe('mindate', function(val) {
if ((val != null) && angular.isDate(val)) {
return scope.restrictions.mindate = val;
}
});
When mindate="{{minDate}}" -> val = ""2015-09-16T15:29:03.330Z""
When mindate="{{minDate | date}}" -> val = "Sep 16, 2015"
The problem is that the code expects a date object.
Nevermind, i updated to "scDateTime" and it worked. Thanks !
HTML:
<time-date-picker ng-model="dateValue" mindate="{{minDate}}"></time-date-picker>
JS:
$scope.minDate = new Date();
Also tried:$scope.minDate = moment();
$scope.minDate = moment().toDate();
Am i doing something wrong here ?