npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-material-time-picker

v1.0.8

Published

Material design time picker for 12 hour and 24 hour time

Downloads

4,808

Readme

npm version

Angular Material Time Picker (md-time-picker)

Angular Material has a date picker, but no time picker. This module is an effort to implement a time picker in Angular Material.

The modal popup is based off mdPickers, but with modifications for 24 hour time, removal of dependency on momentjs, and improvements in usability.

The "time input field" is made up of three individual text inputs for hour, minute, and meridiem. This allows better cross browser support, especially for older browsers that do not support time input.

Screenshots

On page

12 hour | 24 hour --------|-------- 12 Hour | 24 hour

Modal

12 Hour | 24 Hour | Minute --------|---------|-------- 12Hour | 24 hour | Minute

Demo

A live Codepen demo. The same html/css file is also included in the demoApp folder.

Requirements

  • 1.5.0 < AngularJS < 2 (angular-messages, angular-animate, angular-aria)
  • Angular Material > 1
  • Material Icons

Installation

Using npm

npm install angular-material-time-picker --save

You may use Webpack to inject this module into your application.

ES5

require('angular-material-time-picker/dist/md-time-picker.css');
var ngTimePicker = require('angular-material-time-picker');
angular.module('myApp', [ngTimePicker]);

ES6

import 'angular-material-time-picker/dist/md-time-picker.css';
import ngTimePicker from 'angular-material-time-picker';
angular.module('myApp', [ngTimePicker]);

Usage

Example Controller

angular.module('demoApp')

.controller('demoAppController', ['$scope','$mdpTimePicker', function($scope) {

    // Model bound to input fields and modal
    $scope.time = new Date();

    // Optional message to display below each input field
    $scope.message = {
      hour: 'Hour is required',
      minute: 'Minute is required',
      meridiem: 'Meridiem is required'
    }

    $scope.readonly = false;

    $scope.required = true;

}]);

Example Template

<md-time-picker ng-model="time" message="message" read-only="readonly" mandatory="required" no-meridiem no-auto-switch></md-time-picker>

Optional Attributes

  • message (takes an object with keys: hour, minute, and meridiem)
  • no-meridiem (changes time picker to 24 hour time, 12 hour time is default)
  • no-auto-switch (stops modal from switching to minutes automatically after an hour is pressed)
  • read-only (set read only on input. Accepts true or false)
  • mandatory (input will be validated as required if true. Accepts true or false).

License

This software is provided free of charge and without restriction under the MIT License