Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@senzil/angular-datetime-range

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@senzil/angular-datetime-range

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

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

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

  • angular.js
  • moment.js
  • moment-range.js
  • 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'])
  • Use directives in a view
<datetime-range ng-model="myDatetimeRange"></datetime-range>

Angular directive datetime range

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

Angular directive time range

Attributes

PropertyUsageDefaultRequired
ng-modelDateRange (moment-range.js) object to bind from controllernoneyes
limits-rangeDateRange (moment-range.js) object with bounds limits for the componentmoment.range(null, null) - all timeno
timezoneTimezone string name (only datetime-range)moment.tz.guess()no
includeSecondsBoolean - Show seconds in directive to set themfalseno
showCloseBoolean - Show close button in directivefalseno
on-changeHandler function that is fired on change of range objectnoneno
on-change-startHandler function that is fired on change of range.start moment objectnoneno
on-change-endHandler function that is fired on change of range.end moment objectnoneno
on-closeHandler function that is fired on close of edit popovernoneno

Dependencies

Keywords

angular

FAQs

Package last updated on 07 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts