Socket
Socket
Sign inDemoInstall

modalmddatepicker

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    modalmddatepicker

Angular Material Datepicker Component


Version published
Weekly downloads
14
Maintainers
1
Install size
58.1 kB
Created
Weekly downloads
 

Readme

Source

Angular Material DatePicker

Just another native Angular Material-Design DatePicker Component. see demo

Installation

You can choose your installation method:

  • bower: bower install modal-md-datePicker --save
  • npm: npm install modalmddatepicker --save
  • Download from github: modal-md-datepicker

Requirements

Usage

Include modal-md-datepicker.min.js in your application.

<script src="bower_components/modalmddatePicker/modal-md-datepicker.min.js"></script>

Toolbar date language is defined by angular-locale library.

Angular separates number and datetime format rule sets into different files, each file for a particular locale. You can find a list of currently supported locales here.

<script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_es-co.js"></script>

Add both mdThemeColors and ModalDatePicker modules as a dependency to your app module.

var app_ = angular.module('app',[
    'ngMaterial', // angular material required 
    ...
    'mdThemeColors', 
    'ModalDatePicker'
]);

Default datepicker

<modal-md-datepicker ng-model="selectedDate"></modal-md-datepicker>

Format date

Attribute date-format: String with plain javascript date format. Format input text result date.

<modal-md-datepicker ng-model="selectedDate" date-format="dd MMMM yyyy"></modal-md-datepicker>

Min Date

Attribute min-date: Date javascript date object with min date.

<modal-md-datepicker ng-model="selectedDate" min-date="{{min_date}}"></modal-md-datepicker>
$scope.min_date = new Date();

Max Date

Attribute max-date: Date javascript date object with max date.

<modal-md-datepicker ng-model="selectedDate" max-date="{{max_date}}"></modal-md-datepicker>
$scope.max_date = new Date();

Locked input

Attribute locked : bool Locks input field to prevent direct write.

<modal-md-datepicker ng-model="selectedDate" locked="true"></modal-md-datepicker>

Options

Attribute options: json Object with language attributes.

Allow to define default language or Strings with month and day names.

lang : optional

Allow to define default language for month and day names in calendar.

<modal-md-datepicker ng-model="selectedDate" options="dp_options"></modal-md-datepicker>
$scope.dp_options = {
    lang : 'en' // en, es, default:es
};
Month and day names : optional

Allow to define default language for month and day names in calendar.

<modal-md-datepicker ng-model="selectedDate" options="dp_options"></modal-md-datepicker>
$scope.dp_options = {
    sort_days : ['D', 'L', 'M', 'M', 'G', 'V', 'S'],
    months : ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],
    short_months : ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic']
}

Toolbar title date language is defined by angular-locale library. More info

title_date_format : optional

Allow to format component title date, with plain javascript date format.

<modal-md-datepicker ng-model="selectedDate" options="format_title_options"></modal-md-datepicker>
$scope.format_title_options = {
    title_date_format : 'EEEE, MMMM d'
};

Example

Live Example: Live simple example in jsfiddle.net.

test/index.html: Test page included in the project with all options implemented.

License

Released under the terms of the MIT License.

Keywords

FAQs

Last updated on 13 May 2016

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