Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why angular material design get rid of date picker

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

like image 312
liqian Avatar asked May 22 '15 03:05

liqian


People also ask

What is Mat-datepicker-toggle?

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.

What is MD datepicker?

The md-datepicker, an Angular Directive, is an input control to select a date and supports ngMessages for input validation.

What is DateAdapter in angular?

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 .


2 Answers

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.

like image 56
Victor Richa Avatar answered Sep 20 '22 00:09

Victor Richa


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

like image 26
Ankur Tiwari Avatar answered Sep 22 '22 00:09

Ankur Tiwari