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

@icgcat/calendar

v0.0.2

Published

A Svelte Calendar based on flatpickr

Readme

License Version X

Flatpickr Calendar Component

This npm package provides a customizable and lightweight calendar component using the Flatpickr library. It is designed to integrate seamlessly with Svelte applications.


Installation

Install the package using npm:

npm install @icgcat/calendar

All required dependencies, including Flatpickr and its styles, will be installed automatically.


Features

  • Date Range Selection: Allows users to select a range of dates.
  • Customizable Options: Configure min/max dates, themes, and callbacks for various events.
  • Localization: Built-in support for Catalan (locale: Catalan).
  • Responsive: Adapts to different screen sizes.

Props

Customizable Properties

  • onChange (optional): Callback triggered when the selected date range changes.
    • Parameters: (selectedDates, dateStr, instance)
  • onReady (optional): Callback triggered when the calendar is initialized.
    • Parameters: (selectedDates, dateStr, instance)
  • onValueUpdate (optional): Callback triggered when the input value updates.
    • Parameters: (selectedDates, dateStr, instance)
  • onClose (optional): Callback triggered when the calendar closes.
    • Parameters: (selectedDates, dateStr, instance)
  • minDate (optional): Minimum selectable date. Default: "01-12-2015".
  • maxDate (optional): Maximum selectable date. Default: Current date.

Usage Example

<script>
    import Calendar from '@icgcat/calendar';

    function handleDateChange(selectedDates, dateStr) {
        console.log('Selected dates:', selectedDates);
        console.log('Formatted date:', dateStr);
    }
</script>

<Calendar 
    minDate="01-01-2020" 
    maxDate="31-12-2023" 
    onChange={handleDateChange} 
/>

Styling

The component comes with minimal styling for integration into your project. You can customize styles by modifying the included CSS:

.calendari {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    margin-bottom: 10px;
    margin-top: 20px;
}

#calendaricon {
    font-size: 24px;
}

#date-range {
    padding: 5px;
    font-size: 16px;
    width: 15vw;
}

Localization

The calendar is pre-configured to use the Catalan locale. If you want to use another locale, import the appropriate file from flatpickr/dist/l10n/ and update the locale property in calendarOptions.


Dependencies

The following dependencies are automatically installed:

  • flatpickr (library for date selection)
  • flatpickr/dist/flatpickr.min.css (default styles)

No additional steps are required to configure dependencies.


License

This project is licensed under the MIT License.