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-bootstrap-datetimepicker-directive

v0.1.3

Published

Forked version from diosney/angular-bootstrap-datetimepicker-directive substantially to add a package.json and allow the dependency to be managed through npm.

Downloads

10

Readme

angular-bootstrap-datetimepicker-directive

A wrapper directive around the bootstrap-datetimepicker component.

How to Use

1- Install the directive via bower (or download it manually, as you prefer)

bower install angular-bootstrap-datetimepicker-directive --save

2- Load all required scripts by eonasdan-bootstrap-datetimepicker. Refer to the official guide.

3- Include the angular-bootstrap-datetimepicker-directive.js into your HTML. A minified variant is provided for production named angular-bootstrap-datetimepicker-directive.min.js.

4- Inject the datetimepicker directive in you angular app:

angular
  .module('myApp', [
    // Other injected modules.

    'datetimepicker'
  ]);

5- You can start using the directive in your HTML in several ways like:

a) Passing in a JSON object with the options

	<input type="text" class="form-control input-sm"

	       datetimepicker
	       datetimepicker-options="{icons:{next:'glyphicon glyphicon-arrow-right',previous:'glyphicon glyphicon-arrow-left',up:'glyphicon glyphicon-arrow-up',down:'glyphicon glyphicon-arrow-down'}}"

	       placeholder="..."
	       name="time"
	       ng-model="ctrl.time">

b) Passing in an angular scoped variable that holds the options

	<input type="text" class="form-control input-sm"

	       datetimepicker
	       datetimepicker-options="{{ ctrl.datetimepicker_options }}"

	       placeholder="..."
	       name="time"
	       ng-model="ctrl.time">

c) Set the default options with the provider and use the datepicker with those default options.

	<input type="text" class="form-control input-sm"

	       datetimepicker

	       placeholder="..."
	       name="time"
	       ng-model="ctrl.time">

	<script type="text/javascript">
		'use strict';

		angular
				.module('app', [
					'datetimepicker'
				])
				.config([
					'datetimepickerProvider',
					function (datetimepickerProvider) {
						datetimepickerProvider.setOptions({
							locale: 'en'
						});
					}
				]);
	</script>

All options are named identically with the same letter case.

Supported eonasdan-bootstrap-datetimepicker options

All of them :) If you find anyone that is causing havoc file an issue. Please, first test that is the directive and not the original jQuery plugin which is causing it.

Setting default values for all datetimepickers

Use the datetimepickerProvider to set them

<script type="text/javascript">
	'use strict';

	angular
			.module('app', [
				'datetimepicker'
			])
			.config([
				'datetimepickerProvider',
				function (datetimepickerProvider) {
					datetimepickerProvider.setOptions({
						locale: 'en'
					});
				}
			]);
</script>

Those default options will be overwritten by the provided in the inline definition.

Why passing an unified JSON and not option by option?

Just one word: simplicity.

The option by option variant have a lot of related issues, one of them is that the directive has to know every single option of the original plugin, how to parse it, how to include it into the directive with the isolated scope and so on. Besides, this limit future options since have to be added too.

There are a lot more but that isn't the goal of this README after all, so I won't do a full enumeration of them.

License

The MIT License (MIT)

Copyright (c) 2015 Diosney Sarmiento

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.