- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AngularJS and HTML5 date input value - how to get Firefox to show a readable date value in a date input?
The <input> elements of type date allows user to enter date, using a text box or using date picker. With the ng-model directive, bins the values of AngularJS application data to HTML input controls. Firefox does not currently support type="date". It will convert all the values to string. Since
you want date to be a real Date object and not a string, so we create another variable, and then link the two variables as done in the below given code
<input type = "date" ng-model = "realdate" /> function MainCtrl($scope, dateFilter) { $scope.date = new Date(); $scope.$watch('date', function (date){ $scope.dateString = dateFilter(date, 'yyyy-MM-dd'); }); $scope.$watch('realdate', function (realdate){ $scope.date = new Date(realdate); }); }
- Related Articles
- HTML DOM Input Date value Property
- Parse string date value input in Java
- Parse string date time value input in Java
- Not showing a placeholder for input type=“date” field with HTML5. How to solve it?
- HTML DOM Input Date Object
- How to display human readable date in HTML?
- How to add a date and time in HTML5?
- How to convert a Date value to string in JDBC?
- How to format date value in JavaScript?
- HTML DOM Input Date autofocus Property
- HTML DOM Input Date disabled Property
- HTML DOM Input Date form Property
- HTML DOM Input Date name Property
- HTML DOM Input Date max Property
- HTML DOM Input Date min Property

Advertisements