Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.

Parses date/time from input using moment

License

simon04/angular-moment-input

Repository files navigation

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.

About

Parses date/time from input using moment

Resources

License

Stars

Watchers

Forks

Packages

No packages published