It makes sense to use mobile default date picker, but how to get a consistent date picker on a regular web application when using material design?
angular material design website(no picker): https://material.angularjs.org/#/
google material design website(has picker): http://www.google.com/design/spec/components/pickers.html
A datepicker is composed of a text input and a calendar pop-up, connected via the matDatepicker property on the text input. There is also an optional datepicker toggle button that gives the user an easy way to open the datepicker pop-up.
The md-datepicker, an Angular Directive, is an input control to select a date and supports ngMessages for input validation.
The DateAdapter DateAdapter is an abstract class that requires a concrete subclass to actually fill in the details of to work with dates. Angular Material includes one such subclass NativeDateAdapter .
The library is still in development. Current version is 0.10.0.
You can check their milestones. The datepicker is scheduled for the next version (0.11.0) and it's been worked on in the branch wip(calendar)and discussed in this thread.
I have the some problem and finally got the solution in the latest release of Angular Material that is 0.11.0-RC1
You can get an ovriew of code below:
<div ng-controller="AppCtrl" class="sliderdemoBasicUsage" ng-app="MyApp">
<br>
<br>
<md-content style="margin: 16px; padding:16px">
<h4>Start Date</h4>
<md-datepicker ng-model="endDate" md-placeholder="Enter start date"></md-datepicker>
<br>
<h4>End Date</h4>
<md-datepicker ng-model="startDate" md-placeholder="Enter end date"></md-datepicker>
</md-content>
</div>
My Controller
angular.module('MyApp')
.controller('AppCtrl', function($scope) {
//do what you want here
});
you can currently use below link to get datepicker in angular material
https://gitcdn.xyz/repo/angular/bower-material/v0.11.0-rc1/angular-material.css
https://gitcdn.xyz/repo/angular/bower-material/v0.11.0-rc1/angular-material.js
or check my code in codepen
http://codepen.io/ankur-tiwari/pen/bVNEKJ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With