New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

teleperiod

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teleperiod

A period picker widget to select over working schedule

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-78.95%
Maintainers
1
Weekly downloads
 
Created
Source

teleperiod

period picker on a time line with working hours

Preview

Technical overview

The calendar is created in SVG using d3 js toolkit. This can be added in any web page and allow to retreive the periods of the selection in a javascript object. It lazy load events and working hours while browsing on dates.

Installation as a bower componenent:

bower install teleperiod

An angular version is available: angular-teleperiod

Features

  • Select one period on a calendar view
  • Display mutiple timelines for references (ex: other pepoles availability, scolar vacations periods ...)
  • Get the duration of the selection period according to working schedule and special events

Usage

Add to page teleperiod.min.js and teleperiod.min.css

create a svg placeholder in page:

    <div class="row">
        <svg id="teleperiod_placeholder"></svg>
    </div>

Initialize teleperiod object with options:

    var teleperiod = new Teleperiod({
        object: d3.select('#teleperiod_placeholder'),
        workingtimes: function(interval) {
        
        },
        events: function(interval) {
        
        },
        onUpdated: function(selection) {
        
        }
    });

Availables options:

PropertyDescription
objecta D3 html element, it will be used as placeholder to load the graph. This option is mandatory
workingtimesA function called to load the working times on the specified interval. The function must return a Q promise. This option is mandatory
eventsA function called to load some events on the specified interval. The function must return a Q promise. This option is mandatory
onUpdatedA function called when the selection is modified, the selection is given as a parameter. This option is mandatory
focusDateA Date object, the graph will be open at this date, if not set, the default value is the current date
selectedEventsarray of events UID, on loaded, the events will be converted to a modifiable selection
dateLocaleA string to represent the locale used in dates functions, default is 'FR_fr'
widthAn integer for the graph width, default is the size of parent container

Add some bottom timeline references using the timeline object:

    var timeline = new Timeline('My timeline', function(interval) {
    
    });
    
    teleperiod.addTimeLine(timeline);

Draw the widget:

    teleperiod.draw();

Set a selected period for modifications:

    teleperiod.setSelection(
        new Date(2015, 1, 10, 0, 0, 0),
        new Date(2015, 1, 11, 0, 0, 0)
    );

Usage exemples

Room reservations, vacation periods request, resources management ...

Keywords

FAQs

Package last updated on 01 Dec 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc