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

konishileecalendar

v1.0.7

Published

_[Baremetrics](https://baremetrics.com) provides one-click analytics & insights for Stripe. **[Get started today!](https://baremetrics.com)**_

Downloads

3

Readme

Baremetrics Date Range Picker

Baremetrics provides one-click analytics & insights for Stripe. Get started today!


The Baremetrics date range picker is a simplified solution for selecting both date ranges and single dates all from a single calender view. There aren't a billion options but the code is pretty basic and modular so feel free to edit however to meet your own needs.

Design by Chris Meeks
Code by Tyler van der Hoeven

View a demo
View in a live production app

Installing

Using the date picker is pretty simple, you've just got to make a couple choices and include a couple settings. Create a div with a daterange class and then either the daterange--double or daterange--single classname for targeting the specific calendar you'd like to generate.

<div class="daterange daterange--double"></div>
<div class="daterange daterange--single"></div>

Next you've just gotta create a new Calendar instance.

new Calendar({
  element: $('.daterange--single'),
  current_date: 'June 15, 2015'
});

new Calendar({
  element: $('.daterange--double'),
  earliest_date: 'January 1, 2000',
  latest_date: new Date(),
  start_date: 'May 1, 2015',
  end_date: 'May 31, 2015',
  callback: function() {
    var start = moment(this.start_date).format('ll'),
        end = moment(this.end_date).format('ll');
    
    console.debug('Start Date: '+ start +'\nEnd Date: '+ end);
  }
});

Base Calendar Params

  • element *required
    • jQuery DOM object of the calendar div you're working on
  • earliest_date
    • The earliest date to show in the calendar
  • latest_date
    • The latest date to show in the calendar
  • callback
    • A function for whenever a new date is saved
    • Inside you have access to variables like this.earliest_date, this.latest_date and this.current_date for doing things with the new dates
  • format
    • Object containing formatting strings for.. you guessed it.. formating your dates
      format: {
        input: 'MMMM D, YYYY', // Format for the input fields
        jump_month: 'MMMM', // Format for the month switcher
        jump_year: 'YYYY' // Format for the year switcher
      }
  • days_array
    • Array of the 7 strings you'd like to represent your days in the calendar
      days_array: ['Su','Mo','Tu','We','Th','Fr','Sa']

Single Calendar Params

  • current_date
    • The date to start the calendar on

Double Calendar Params

  • callback
    • The double calendar includes access to this.end_date and this.start_date
  • start_date
    • The date to start the selection on for the calendar
  • end_date
    • The date to end the selection on for the calendar
  • format
    • The double calendar adds the preset key to the format object for formatting the preset dates in the preset dropdown
  • same_day_range
    • Allow a range selection of a single day

Developing

I've included my signature gulpfile too so be sure and take a look at that as well.

$ cd <project directory>
$ npm install
$ gulp

I also use pow and the powder gem to run my local dev environments but however you plan on wrangling that the gulpfile turns on a livereload server so as long as you have the files serving somehow any changes you make will show up instantly.

Dependencies