angular-time-pick

1.0.1 • Public • Published

bs-time-pick Build Status

A basic time picking directive for entering and validating the time of day.

Installation

bs-time-pick requires jquery and Angular 1.3.*

Install bs-time-pick with bower or npm

  bower install --save bs-time-pick
  npm install --save bs-time-pick

Or manually download the built file

Usage

Make your angular app depend upon the bs-time-pick module

angular.module("app", ["bs-time-pick"]);

This directive is intended to work together with ng-model which needs to be provided with a valid date object. If ng-model is null, a new Date will be created for the current day and bound to ng-model. The date model passed to ng-model can easily be shared with a date-picker widget which can select the year, month, day, and bs-time-pick can input the time of day.

NOTE You must use ng-model-options={ updateOn: "blur" }

Options:

  • bs-shake-count - the number of shakes the element will be given when invalid data is entered
  • bs-shake-distance - the distance of the shaking
  • bs-shake-duration - the duration of the shaking in milliseconds

Example

  <input type="text" ng-model="myDate" ng-model-options={ updateOn: "blur" } />
  {{ myDate | date:"h:mm a" }}

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i angular-time-pick

    Weekly Downloads

    7

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • blittle