Skip to content

larmaysee/ng-flatpicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-flatpicker

Angularjs directive for flatpickr.Pleas do the following to use ng-flatpicker.

  • just add ng-flatpicker to your input.Default dateformat is Y-m-d.
  • You can specify alot of options. To do that just add options attribute object in your element.

Prerequires

Before installation you must to include flatpickr to your project.

Installation

Install with npm

  npm i ng-flatpickerr

After run the above command

  • Include ng-flatpicker.min.js to your project.
  • And then add ng-flatpicker modules to your angularjs application.

Example

var myapp = angular.module("myapp", ["ng-flatpicker"]);

Usage

To use ng-flatpicker you just need add ng-flatpicker attribute and options to your element.

<input
  type="text"
  ng-flatpicker
  options="{dateFormat:'Y-m-d'}"
  placeholder="Select a date"
  ng-model="demoDate"
/>

Example with angularjs

Define options to your controller.

var myapp = angular.module("myapp", ["ng-flatpicker"]);

angular.module("myapp").controller("demoCtrl", function($scope) {
  $scope.options = {
    dateFormat: "Y-m-d",
    enabledTime: true
  };
});

and then to your view file

<input
  type="text"
  ng-flatpicker
  options="options"
  placeholder="Select a date"
  ng-model="demoDate"
/>

Note: Need to deine ng-model in your element.

License

ng-flatpicker module is under MIT license see project root

About

Date Time picker library with angularjs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published