angular-moment-input

Parses date/time from input using moment


License
MIT
Install
bower install angular-moment-input

Documentation

angular-moment-input

Parses date/time from input using moment

Usage

Obtain module

$ bower install --save angular-moment-input

Add module dependency to angular app

angular.module('...', ['angular-moment-input'])

Use directive ng-moment-input (together with an ng-model)

<input ng-model="..." ng-moment-input="config">

Configuration

The config object is optional. The following keys are supported:

  • formats An array of moment.js formats. The first one is used for rendering the model value. All formats are used for parsing. Defaults to YYYY-MM-DD.

  • strict Enable/disable strict parsing. Defaults to true.

  • moment The moment parse function to use. Specify moment.utc for parsing in UTC mode. Defaults to moment.