Angular.js has a built-in date filter.
demo
// in your controller: $scope.date = '20140313T00:00:00'; // in your view, date property, filtered with date filter and format 'MM/dd/yyyy' <p ng-bind="date | date:'MM/dd/yyyy'"></p> // produces 03/13/2014
You can see the supported date formats in the source for the date filter.
edit:
If you’re trying to get the correct format in the datepicker (not clear if you’re using datepicker or just trying to use it’s formatter), those supported format strings are here: https://api.jqueryui.com/datepicker/
Related Posts:
- Change date format in a Java string
- typeerror cannot read property ‘data’ of undefined
- nodemon app crashed – waiting for file changes before starting
- Refused to display in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’
- Refused to display in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’
- Angular-ui-router: ui-sref-active and nested states
- Current time formatting with Javascript
- Unable to resolve dependency tree error when installing npm packages
- Understanding STATE in angularJS
- What is .$on() in AngularJS
- Significance of ng-repeat-start vs ng-repeat
- Format JavaScript date as yyyy-mm-dd
- File Upload using AngularJS
- AngularJS : Prevent error $digest already in progress when calling $scope.$apply()
- AngularJS BootstrapUI Typeahead with object & selection functionality
- angular.service vs angular.factory
- How do I store data in local storage using Angularjs?
- What is .$on() in AngularJS
- `ui-router` $stateParams vs. $state.params
- Simple Popup by using Angular JS
- $apply already in progress error
- Why do i have to call $scope.$digest() here?
- ng-repeat :filter by single field
- What is deep linking in AngularJS?
- Difference between onLoad and ng-init in angular
- How do I fix the npm UNMET PEER DEPENDENCY warning?
- MySQL date formats – difficulty Inserting a date
- Submit form on pressing Enter with AngularJS
- How to $state.go()
- AngularJS ng-disabled directive with expression is not working
- With ng-bind-html-unsafe removed, how do I inject HTML?
- How to filter a select with ng-options in Angular?
- What is the use of angular ui-mask?
- Response for preflight has invalid HTTP status code 403 on angular post request
- How to achieve pagination/table layout with Angular.js?
- Angular js is front end or backend?
- AngularJS Folder Structure
- Bare minimum code for AngularJS Carousel
- AngularJS $watch vs $watchCollection: which is better for performance?
- Angular.js: How does $eval work and why is it different from vanilla eval?
- angular.element vs document.getElementById or jQuery selector with spin (busy) control
- Angularjs ng-view does not work
- getting the ng-object selected with ng-change
- AngularJS For Loop with Numbers & Ranges
- Why is .then not a function?
- How do I filter an array with AngularJS and use a property of the filtered object as the ng-model attribute?
- In AngularJS, what’s the difference between ng-pristine and ng-dirty?
- AngularJS Modal Popup
- Why do we use $rootScope.$broadcast in AngularJS?
- how to use ng-option to set default value of select element
- What does ngInject do in the following piece of code?
- AngularJS: how to implement a simple file upload with multipart form?
- Calculate business days
- How to format a JavaScript date
- How to format a JavaScript date
- How to format a JavaScript date
- How to get all place details from a Place Details Request using Google Places API Web Service?
- AngularJS vs Angular [closed]
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- How do I get the current date in JavaScript?
- Java string to date conversion
- Get String in YYYYMMDD format from JS date object?
- How to get current timestamp in string format in Java? “yyyy.MM.dd.HH.mm.ss”
- Compare two dates with JavaScript
- Compare dates with javascript
- What’s the difference between ISO 8601 and RFC 3339 Date Formats?
- How to get current time and date in C++?
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- ORA-01843 not a valid month- Comparing Dates
- Looking for a clear description of Excel’s .xlsx XML format
- Teradata: how to convert varchar value (format ‘dd.mm.yyyy’) to date (format ‘yyyy-mm-dd’ )?
- Is there any way to change input type=”date” format?
- Python TypeError: not enough arguments for format string
- How to get current time and date in C++?
- AngularJS- Login and Authentication in each route and controller
- TypeError: Cannot read property ‘then’ of undefined
- Mysql: Setup the format of DATETIME to ‘DD-MM-YYYY HH:MM:SS’ when creating a table
- Add days to JavaScript Date
- Parsing a string to a date in JavaScript
- Get the current year in JavaScript
- How to Create simple drag and Drop in angularjs
- Working with $scope.$emit and $scope.$on
- Query comparing dates in SQL
- How to compare dates in Java?
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- C – The %x format specifier
- Java SimpleDateFormat for YYYY-MM-DDThh:mm:ssTZD
- Regular expression : match either of two conditions?
- SyntaxError: Unexpected token o in JSON at position 1
- ORA-01830: date format picture ends before converting entire input string / Select sum where date query
- Convert java.util.Date to String
- AngularJS : Factory and Service?
- How do I use PHP to get the current year?
- AngularJS ngClass conditional
- Give a value to an ng-model=”searchText” input based on list item clicked in Angular JS
- LocalDate to java.util.Date and vice versa simplest conversion?
- Oracle date format picture ends before converting entire input string
- TypeError: Cannot read property ‘get’ of undefined on AngularJS