Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

so I am trying to bind value for input of type date..

Here is my AngularJS code that I am trying to bind the value to:

$scope.date = new Date();
$scope.dateString = dateFilter($scope.date,'dd-MM-yyyy');

And html:

<input class="date" type="date" ng-bind="dateString">

What I am trying to do, is I am trying to set default value to todays date. However, when I am loading my page, it just gives me following result:

<input class="date ng-binding" type="date" ng-bind="dateString">08-04-2015</input>

Any help will be more than welcome :)

Thanks, uksz

share|improve this question
    
which version of angular are you using? – Sam Apr 8 at 16:09
    
you need to be using version 1.3 or higher for date support. you also want to use ng-model instead of ng-bind, because ng-bind is one way only – Sam Apr 8 at 16:15

1 Answer 1

up vote 0 down vote accepted

You need to be using version 1.3 or higher for date support. you also want to use ng-model instead of ng-bind, because ng-bind is one way only

share|improve this answer
    
Thanks so much! Turns out I am using 1.2.26. – uksz Apr 8 at 16:18
    
Is updating version pretty straight forward? Or I need to take a look at keynotes, to change my code :)? – uksz Apr 8 at 16:18
    
Ok, so most likely I wont be able to update to 1.3 as ionic framework doesnt support it yet. Is there any way i can go around this problem? – uksz Apr 8 at 16:25
    
are you using bootstrap, there are a selection a date picker directives that you can use. If you are using bootstrap, then this: github.com/dalelotts/angular-bootstrap-datetimepicker – Sam Apr 8 at 16:35
    
Actually, dependencies you will need are: AngularJS 1.2.26 or higher (1.0.x will not work) moment.js 2.8.3 or higher for date parsing and formatting bootstrap's glyphicons for arrows (Can be overridden in css) – Sam Apr 8 at 16:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.