On second thoughts, you can put Date.parse method in $scope too. Fiddle: http://jsfiddle.net/a14gww42/
On Tue, Feb 17, 2015 at 7:16 PM, Atul Vani <[email protected]> wrote: > The 'Date' is not a date object but a string. Use datejs or momentjs to > convert it to date. > > On Tue, Feb 17, 2015 at 5:52 PM, Rakesh Yeluri <[email protected]> > wrote: > >> Hi All, >> >> I have scope property which have below format in my controller, >> >> $scope.event = { >> name : 'xyz', >> city : 'Florida', >> sessions: [ >> { >> exp: '5', >> UpvoteCount : 2, >> Date: '10/12/2015' >> }, >> { >> exp: '2', >> UpvoteCount: 5, >> Date: '1/12/2015' >> }, >> { >> exp: '1', >> UpvoteCount: 8, >> Date: '15/12/2015' >> } >> ] >> } >> >> and in the view, I'm trying to fetch in the below format, >> >> <li ng-repeat="x in event.sessions"> >> {{ x.Date | date:'MM-dd-yyyy' }} >> </li> >> >> >> Output I'm getting like below: >> 10/12/2015 >> 1/12/2015 >> 15/12/2015 >> >> Can some one address/suggest why the format is not applying to the date. >> >> Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
