Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

A simple and fluid inline datepicker for AngularJS with no extra dependencies.

License

Notifications You must be signed in to change notification settings

renato/angular-pickadate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-pickadate Build Status

A simple and fluid inline datepicker for AngularJS with no extra dependencies.

pickadate

Demo

View demo in a new window

Installation

  1. Add the pickadate module to your dependencies
angular.module('myApp', ['pickadate']);
  1. Use the pickadate directive in any element
<div pickadate ng-model="date"></div>

Pickadate is fluid, so it will take the width of the parent container.

Pickadate options

min-date, max-date

<div pickadate ng-model="date" min-date="minDate" max-date="maxDate"></div>
function MyAppController($scope) {
    $scope.minDate = '2013-11-10';
    $scope.maxDate = '2013-12-31';
}

min-date and max-date take angular expressions, so if you want to specify the values inline, don't forget the quotes!

<div pickadate ng-model="date" min-date="'2013-11-10'" max-date="'2013-12-31'"></div>

disabled-dates

<div pickadate ng-model="date" disabled-dates="disabledDates"></div>
function MyAppController($scope) {
    $scope.disabledDates = ['2013-11-10', '2013-11-15', '2013-11-19'];
}

default-date

Allows you to preset the calendar to a particular month without setting the chosen date.

<div pickadate default-date="presetDate"></div>
function MyAppController($scope) {
    $scope.presetDate = '2013-12-01';
}

show-year-nav

Shows a next/previous year navigation in addition to the current next/previous month.

<div pickadate show-year-nav="'true'"></div>

week-starts-on

Sets the first day of the week. The default is 0 for Sunday.

<div pickadate week-starts-on="1"></div>

no-extra-rows

The calendar will have between 4 and 6 rows if this attribute is present. By default it will always have 6 rows.

<div pickadate no-extra-rows></div>

I18n

Pickadate uses angular $locale module for the date translations. If you want to have the calendar in any other language, please include the corresponding AngularJS i18n files. You can get them here: http://code.angularjs.org/1.2.0-rc.2/i18n/.

For the remaining translations you can configure the pickadateI18nProvider.

angular.module('testApp', ['pickadate'])

    .config(function(pickadateI18nProvider) {
        pickadateI18nProvider.translations = {
            prev: 'ant',
            next: 'sig'
        }
    });

Future development

Currently pickadate only works as an inline datepicker, but would like it to make it work in any text input as an overlay like the jquery-ui one. Will be happy to merge your pull requests.

License

Copyright (c) 2013 Restorando

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A simple and fluid inline datepicker for AngularJS with no extra dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.8%
  • CSS 10.2%