Socket
Socket
Sign inDemoInstall

md-date-picker

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    md-date-picker

Angular Material Customizable Date Picker Directive


Version published
Weekly downloads
16
increased by45.45%
Maintainers
1
Install size
2.15 MB
Created
Weekly downloads
 

Readme

Source

md-date-picker

angular material customizable date picker directive/component

NPM

Demo

Live

https://ipiz.herokuapp.com/md-date-picker/demo/index.html

Local

  • clone repository
  • npm install
  • gulp serve

Dependencies

angularjs, angular material

PackageVersions
angular>=1.4 <=1.6
angular-material1.x

usage

bower install md-date-picker --save
//or
npm install md-date-picker --save
//module
var app = angular.module('app', ['md-date-picker']);
//options
$scope.specialDaysClass['8/5/2017'] = 'blue-day'; // blue color on saturday 
$scope.specialDaysClass['1/1/2017'] = { // red color on new years day with title
  class: 'red-day',
  title: 'New Year',
};
// sample custom css
.blue-day {
  color: blue;
}
.red-day {
  color: red;
}
<!--default-->
<md-date-picker ng-model="date" on-change="date = $date" placeholder="Select Date"></md-date-picker>
<!--show only days on current month view-->
<md-date-picker current-month-view-dates-only="true" ng-model="date" on-change="date = $date"></md-date-picker>
<!-- with special days calss and promise handling -->
<md-date-picker loading="loading" date-class="specialDaysClass" on-render="onRenderDatePicker($month, $year)" ng-model="date" on-change="date = $date"></md-date-picker>
<!-- customizable date format -->
<md-date-picker ng-model="custom" format="EEE, MMM dd, yyyy" on-change="custom = $date"></md-date-picker>

Attributes

AttributesTypeBindingDescription
ngModelDateOne-way bindingYour date object model
onChangeFunctionEventHandle on select date, ussage on-change="model = $date"
formatStringattributeUses angular date filter to format date format="EEE, MMM dd, yyyy" refer to https://docs.angularjs.org/api/ng/filter/date
dateClassObjectOne-way bindingUse to style dates date-calss="{'12/25/2017':{class: 'red-font'}}"
loadingBooleanOne-way bindingUse to create overlay on calendar with md-linear-progress
openOnFucosBooleanOne-way bindingUse open picker when focused
ngRequiredBooleanOne-way bindingUse set the date picker input required
ngDisabledBooleanOne-way bindingUse set the date picker input disabled
showIconBooleanOne-way bindingshow calendar icon
placeholderStringattributeAs input placeholder placeholder="Select Date"
dateFilterFunctionOne-way bindingUse as callback function to filter available dates, function should return false to be able to disable date. Example enable only Mondays in picker function isAvailable(date) { return date.getDay() === 1; }
currentMonthViewDatesOnlyBooleanEventUse to toggle displaying other Month dates in a current calendar view
onRenderFunctionEventTrigger when a render of the calendar view happen, mostly on next/prev month clicked or on First render
clone repository and run gulp for demo http://localhost:3000

md-date-picker Screenshot

Todos

  • Enhancements
  • Optimizations
  • Unit Tests

License

MIT

Version 0.0.1

Keywords

FAQs

Last updated on 06 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc