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

@senzil/angular-datetime-range

v1.0.2

Published

UI widget for datetime range input, converted to an angular directive for your convenience.

Downloads

13

Readme

Datetime range and Time range input UI element

This directive is designed to provide easy and intuitive input of moment-range.js datetime range objects.

Typically this can be used to represent a moment range with start and an end datetime objects.
Desgined to be as simple as possible to afford intuitive interactions, including scrolling.

Converted into an angular directive for your convenience :)

This work was based over the angular-date-time directive but forked to use an moment-range.js as ng-model

Demo

Click here for a live demo.

Installation

#####1) Install '@senzil/angular-datetime-range'

npm install @senzil/angular-datetime-range
yarn add @senzil/angular-datetime-range
    
https://cdn.rawgit.com/senzil/angular-datetime-range/v1.0.0/dist/datetime-range.min.js
https://cdn.rawgit.com/senzil/angular-datetime-range/v1.0.0/dist/datetime-range.min.css

#####2) Prerequisites

You must set up these dependencies

  1. angular.js
  2. moment.js
  3. moment-range.js
  4. moment-timezone.js

######NPM or YARN if you use npm or yarn, the dependencies will download with the directive.

######In Browser In the browser you must add the scripts

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment-with-locales.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.13/moment-timezone-with-data.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-range/3.0.3/moment-range.js" charset="utf-8"></script>

#####3) Add 'senzil.datetime-range' module to your app config

angular.module('myApp', ['senzil.datetime-range'])
  1. Use directives in a view
<datetime-range ng-model="myDatetimeRange"></datetime-range>

<time-range ng-model="myTimeRange"></time-range>

Attributes

|Property | Usage | Default | Required | |:------------- |:-------------|:-----:|:-----:| | ng-model | DateRange (moment-range.js) object to bind from controller | none | yes | | limits-range | DateRange (moment-range.js) object with bounds limits for the component| moment.range(null, null) - all time | no | | timezone | Timezone string name (only datetime-range)| moment.tz.guess() | no | | includeSeconds | Boolean - Show seconds in directive to set them | false | no | | showClose | Boolean - Show close button in directive | false | no | | on-change | Handler function that is fired on change of range object | none | no | | on-change-start | Handler function that is fired on change of range.start moment object | none | no | | on-change-end | Handler function that is fired on change of range.end moment object | none | no | | on-close | Handler function that is fired on close of edit popover | none | no |

Dependencies