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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mats-maker/schedule-calendar

v0.0.2

Published

This is utility for calculate time by schedule

Readme

Time by schedule

Small utility for calculate work time by schedule

Example:

We have week schedule with exceptions:

          [
            {
                indexOfday: 0,   // Index of day
                from: 28800,     // 8:00 AM Start of work day this is number seconds from start the day
                to: 63000,       // 5:30 PM End of work day this is number seconds from start the day
                isActive: true   // Toggler - active or not active this day. Possibly will need when schedule will be editing and need show some time
            }, {
                indexOfday: 1,
                from: 28800,
                to: 63000,
                isActive: true
            }, 
            ...
            ...
            {
                indexOfday: 4,
                from: 28800,
                to: 63000,
                isActive: true
            }, {
                indexOfday: 5,
                from: null,   // saturday is day of rest
                to: null,     // saturday is day of rest
                isActive: false
            }, {
                indexOfday: 6,
                from: null,   // sunday is day of rest
                to: null,     // sunday is day of rest
                isActive: false
            }
        ],
        exceptions: [{
            date: '2017-04-19T08:45:56.053Z',
            from: 28800,
            to: 63000,
            isActive: false
        }, {
            date: '2017-04-20T08:45:56.053Z',
            from: 32400,
            to: 50400,
            isActive: true
        }

We will have from 2017-04-16T14:00:00 to 2017-05-01T14:00:00 result 87:00 work time, has two exceptions on different week

How it use

const shedule = {
        week: [
            {
                indexOfday: 0,          // Index of day 0-6
                from: 28800,            // Start of work day this is number seconds from start the day
                to: 63000,              // End of work day this is number seconds from start the day
                isActive: true
            }, {
                indexOfday: 1,
                from: 28800,
                to: 63000,
                isActive: true
            }, {
                indexOfday: 2,
                from: 28800,
                to: 63000,
                isActive: true
            }, {
                indexOfday: 3,
                from: 28800,
                to: 63000,
                isActive: true
            }, {
                indexOfday: 4,
                from: 28800,
                to: 63000,
                isActive: true
            }, {
                indexOfday: 5,
                from: null,
                to: null,
                isActive: false
            }, {
                indexOfday: 6,
                from: null,
                to: null,
                isActive: false
            }
        ],
        exceptions: [] // also you can set exceptions
    };
const timetable = new Timetable(shedule);
const startTimeDuration = 1492437600                              // 2017-04-17T14:00:00
const endTimeDuration = 1492448400                                // 2017-04-17T20:00:00
const result = timetable.timeOfDuration(1492437600, 1492448400)); // 12600 this is 3:30 work's time by shedule