Have you looked into the date filter? It sounds like it may do what you need.
https://docs.angularjs.org/api/ng/filter/date On Wednesday, December 23, 2015 at 3:00:40 AM UTC-5, ShatterStar wrote: > > Hi Guys, > > I am trying to get the date that I have as a hidden field to be the > current date which would include the year, month and day eg. 2015-12-25, > this is how I am doing it thus far but is there a better / easier way? > Here's the code > > var newDate = new Date(); > dateYear = newDate.getFullYear(); > dateMonth = newDate.getMonth(); > dateDay = newDate.getDate(); > $scope.myDate = dateYear + " " + dateMonth + " " + dateDay; > > > > -- 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 https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
