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

modui-calendar-pane

v2.1.0

Published

A calendar for the backbone.js-based modui suite. By [Adrian Adkison](https://github.com/trainiac).

Downloads

4

Readme

modui-calendar

A calendar for the backbone.js-based modui suite. By Adrian Adkison.

Installation

npm install modui-calendar

Usage

var ModuiCalendar = require( 'modui-calendar' );

var calendar = new ModuiCalendar( [options] );

Options

selectedDate

Date The date to display as the current selected date. If this option is not supplied no date will be initially selected.

maxDate

Date The maximum date that can be selected, or undefined (default) if no maximum should be enforced.

minDate

Date The minimum date that can be selected, or undefined (default) if no minimum should be enforced.

numberOfMonths

Number The number of months to display vertically. Defaults to 1.

firstVisibleMonth

Date A date that has the year and month set to that which you want to display initially. If no value is supplied for this option, and a selectedDate is supplied, the month of the selectedDate will be displayed. If neither firstVisibleMonth or selectedDate are supplied then the current month (i.e. NOW) is displayed.

getDateClasses( date )

Function If supplied, this callback will be invoked when rendering each day in the calendar. It will be passed a date object representing that day and should return a String of space-separated css classes to be added to that day's HTML element.

Internationalization Options

dayLabels

Array An array of strings that should be used as the day display labels. Defaults to [ 'Su', ..., Sa' ]. The array should always start with the string that represents Sunday. (If you want your calendar weeks to begin with Monday, use the weekStartsOnMonday option.)

monthLabels

Array An array of strings that should be used as the month display labels. Defaults to [ 'January', ...,'December' ].

weekStartsOnMonday

bool If true, Monday displayed as the first day of the week instead of Sunday.

displayYearBeforeMonth

bool Does what it says. Defaults to false.

Public Methods

goNextMonth

Moves the calendar display to the next month.

goPreviousMonth

Moves the calendar display to the previous month.

Events

The following events are triggered with Backbone.Courier, so you can either listenTo them normally or handle them in a Courier onMessages hash.

dateSelected (date)

Triggered when the selectedDate is changed, either via the public method setOptions( {selectedDate : someDate} ) or by the user selecting a date in the UI. The event callback will be passed a Date object representing the date that was selected.

monthChanged (firstDayOfMonth)

Triggered when the month being displayed changes, either via the public methods goNextMonth and goPreviousMonth or by the user navigating months in the UI. The event callback will be passed a Date object representing the first day of the new display month. (If numberOfMonths is greater than 1, the Date will represent the first day of the first month.)

Development

modui-calendar is a CommonJS module. To compile its assets you can you use browserify and sass.

# developing the js
$ watchify /path/to/modui-calendar/demo/demo.js -o /path/to/modui-calenar/build/demo.js --debug

# developing the scss
$ sass --watch /path/to/modui-calendar/demo/demo.scss:/path/to/modui-calendar/build/demo.css

Or you can compile both asset types at once with parcelify,

$ parcelify demo/demo.js -j build/demo.js -c build/demo.css -wm

Then review your changes by loading the demo.html file.

Build

Similarly, to build for production,

$ parcelify demo/demo.js -j build/demo.js -c build/demo.css

License

MIT