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 toYYYY-MM-DD
. -
strict
Enable/disable strict parsing. Defaults totrue
. -
moment
The moment parse function to use. Specifymoment.utc
for parsing in UTC mode. Defaults tomoment
.