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

weekli.js-personalized

v1.1.5

Published

Javascript component that enables users to quickly select their availability on a week calendar.

Downloads

4

Readme

weekli.js

a pure javascript component that allows your users to effortlessly input their availability on a week calendar

Version 1.0.1

Demo and Examples weekli capture

Get your hands on it

Bower

bower install weekli.js --save
<link rel="stylesheet" type="text/css" href="bower_components/weekli.js/css/weekli.css"/>

<script type="text/javascript" src="bower_components/weekli.js/js/weekli.min.js"></script>

NPM

npm install weekli.js --save
<link rel="stylesheet" type="text/css" href="node_modules/weekli.js/css/weekli.css"/>

<script type="text/javascript" src="node_modules/weekli.js/js/weekli.min.js"></script>

Github

git clone https://github.com/collnwalkr/weekli.git

Usage

Basic Usage:

<!--
    A weekli component needs an empty div tag with an id.
    By default, a new Weekli() object targets an id of 'weekli'
    The id allows multiple, non-competing weekli's on a 
    single page. Note the id used on this div and in the 
    new Weekli object must be the same... 
-->
<div id="weekli"></div>
// creates new Weekli object and builds it with default options
var weekli = new Weekli();
weekli.build();
// get the JSON output
var weekli_output = weekli.get_output();
// example output
{
  "available": [
        {
          "day": "WED",
          "time": "7:00 am-8:00 am"
        }
    ],
  "unavailable": [
        {
          "day": "WED",
          "time": "8:00 am-9:00 am"
        }
    ]
}

Custom Usage:

A weekli object can be instantiated with custom properties.

// all customization properties and their default value
var weekli = new Weekli({
    wk_id: 'weekli',
    week: 'workweek',
    week_days: [],
    minute_interval: '60',
    time_range: '7:00,12:00',
    editable: true,
    time_format: '12hour'
});

| attribute | accepted value and examples | |:------------------------------|:-------------| | wk_id: | string specifies the div id that weekli is in (example if <div id = "weekli_custom"> </div> then wk_id: 'weekli_custom' | | week: | week , workweek , weekend , or custom. determins which days of the week should be shown in columns: | | week_days: | if week is custom, days of the week will be pulled from this array of strings (ex: week_days: ['Sunday', 'Tuesday', 'Friday']) | | minute_interval: | int determines the time-span for each row (ex: minute_interval: 60 = 7:00 - 8:00 , minute_interval: 75 = 7:00 - 8:15) |
|time_range: | int,int specifies the start and end times for the rows (ex: time_range: 10:15,15:30 = 10:15 am - 3:30 pm) |
| editable: | true or false determines if weekli component can be changed by user interaction | | time_format: | 12hour or 24hour specifies if time should be shown in civilian or military format | In addition, weekli objects have several public functions.

    weekli.make_uneditable();
    // weekli will now ignore all user input

    weekli.make_editable();
    // weekli will react to user input

    weekli.load_data(JSON);
    // clear the calendar, then load in the JSON object
    // and display the available times
    
    weekli.all_available();
    // make all times available
    
    weekli.all_unavailable();
    // make all times unavailable

Custom Styling:

Weekli is styled with less. All of the basic coloring, font sizes, and window-size breakpoints can be found in the weekli.less file. However, there are some conditionals in the less file that are noteworthy:

// CONDITIONALS
@wk-border:               false;
@wk-day-abbreviated:      true;
@wk-hide-ampm:            true;

| conditional | result explained | |:------------------------------|:-------------------------------------| | @wk-border: | true border is shown while false hides the border | | @wk-day-abbreviated: | true when screeen is @tablet size, days of the week will be abbreviated (ex: 'Monday' becomes 'Mon'). false will not abbreviate days of the week | | @wk-hide-ampm: | true will hide 'A.M' or 'P.M' from being displayed in the time row. However, the get_output() JSON file will still have 'A.M' or 'P.M' still in the data structure. false will show the 'A.M' or 'P.M' in the time row |