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

ibusy

v1.0.13

Published

time management tool

Downloads

8

Readme

npm version CI/CD

IBusy

logo

IBusy tool can help you to create and enhance your time management tools and make them better and easier to make them because IBusy has great features that can help you in that.

1 - By IBusy you can get the free period between multiple periods Ex.. likes if you have a person and he is working in specifics times also he has holidays and absences and times he isn't available into so you can get only the times he available into between these periods.

2 - By IBusy you can filter and sort the duplication between multiple periods Ex.. if you have many dates and periods into an array and you need to remove the duplications and nested array and get only the unique periods like that

Demo

Installation

<script src="https://cdn.jsdelivr.net/npm/ibusy@latest/dist/ibusy.js"></script>

Or NPM

npm i ibusy

Overview

<script src="https://cdn.jsdelivr.net/npm/ibusy@latest/dist/ibusy.js"></script>
<script>
  const _ibusy = new ibusy.IBusy();
  const periods = _ibusy.getAllowedPeriodsBetween(
    [
      {
        start: new Date("2021-12-29T01:00:00.000Z").getTime(),
        end: new Date("2021-12-29T22:00:00.000Z").getTime(),
      },
    ],
    [
      {
        start: new Date("2021-12-29T02:00:00.000Z").getTime(),
        end: new Date("2021-12-29T21:00:00.000Z").getTime(),
      },
    ]
  );
</script>

Get the free or available periods by calling getAllowedPeriodsBetween of the global object ibusy and first argument will be the allowed periods. and second argument will be the disallowed periods.

Just simple 😉.

API

getAllowedPeriodsBetween(allowedPeriods, disallowedPeriods);

Pass your allowed and disallowed periods as arguments then IBusy will return the allowed periods after remove the disallowed periods sorted and filtered and detailed so you can use after that.

  • Arguments:

| Name | Type | Required | Description | | ----------------- | -------------------- | -------- | --------------------------------------------------------------------- | | allowedPeriods | Array<InputPeriod> | true | array of type InputPeriod for the available or allowed periods | | disallowedPeriods | Array<InputPeriod> | true | array of type InputPeriod for the unavailable or disallowed periods |

  • Returns:

| Type | Description | | -------------------- | ---------------------------------------------------------------------------------------------------------------------- | | Array<InputPeriod> | array of type InputPeriod for the available or allowed periods between the two inputs allowed and disallowed periods |

Types

  • InputPeriod

| Name | Type | Required | Example | Description | | ----- | -------- | -------- | ------------- | ------------------------ | | start | number | true | 1640739600000 | The date as milliseconds | | end | number | true | 1640743200000 | The date as milliseconds |

  • Period

| Name | Type | Required | Example | Description | | -------- | -------- | -------- | ------------- | ----------------------------------------------------------- | | start | number | true | 1640739600000 | The date as milliseconds | | end | number | true | 1640743200000 | The date as milliseconds | | duration | number | true | 480 | The difference between end and start date into milliseconds |

  • Dependencies: | Name | Version | | ------ | ------- | | moment | 2.29.1 |

  • Dev | Name | Version | | ---------- | ------- | | typescript | 4.5.4 | | jest | 27.0.3 |

Contribution

I welcome you to fork and add more features into it. If you have any bugs or feature request, please create an issue at github repository.