I am displaying date in this format using angular
{{ date }} ,date:\\\'MM-dd-yyyy HH:MM:ss\\
how to display like Jan-dd-yyyy
Well,
according to the docs, you have a builtin filter in angular, called date
:
<p>{{Date.now() | date:'yyyy'}}
would render to:
<p>2013</p>
The yyyy
in this case can be any format string documented. In the example you gave, this would be:
{{date | date: 'MMM-dd-yyyy'}} # => "Jan-21-2013" (if date was a date object for this day)
Try this
{{ date }} ,date:\'MMM-dd-yyyy HH:MM:ss\
For custom date:
$scope.user.dob = new Date('1980', '12' ,'10'); // controller code
{{user.dob | date : 'MMM-dd-yyyy'}} // Dec-10-1980
For current date:
$scope.user.current= new Date(); // controller code
{{user.current | date : 'MMM-dd-yyyy'}} // Current date in given format
use Angular filter of date.
{{date | date:'MM-dd-yyyy HH:MM:ss'}}
See the following link.
http://docs.angularjs.org/api/ng.filter:date