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

@vmang0/datepicker-lib

v1.0.6

Published

This library provides three main components: RangeDatePicker, DatePicker, and TaskCalendar. These components are designed to help you manage dates and tasks efficiently in React applications.

Downloads

2

Readme

DatePicker Library

This library provides three main components: RangeDatePicker, DatePicker, and TaskCalendar. These components are designed to help you manage dates and tasks efficiently in React applications.

Components

1. DatePicker

A simple date picker component for selecting a single date.

Props:

  • selectedDate (Date): The currently selected date.
  • selectDate (Function): Callback function to update the selected date.

2. RangeDatePicker

A date picker component for selecting a range of dates.

Props:

  • startDate (Date): The currently selected start date.
  • endDate (Date): The currently selected end date.
  • selectDate (Function): Callback function to update the selected date range.
  • handleFooterClick (Function): Callback function to handle footer button clicks.
  • isRenderFooter (Boolean): Whether to render the footer section.
  • footerTitle (String): The title for the footer button.

3. TaskCalendar

A calendar component for managing tasks.

Props:

  • selectedDate (Date): The currently selected date.
  • selectDate (Function): Callback function to update the selected date.
  • isViewTasks (Boolean): Whether to display tasks.

Shared Props

These props can be passed to any of the components (DatePicker, RangeDatePicker, TaskCalendar):

  • locale (String): The locale to use for the calendar. Default is 'default'. Example es-US.
  • firstWeekDay (String): The first day of the week. Default is Monday. Various: Monday / Sunday
  • maxRangeDate (Object): The maximum date to display. Default is the start of the current year + 74.
  • minRangeDate (Object): The minimum date to display. Default is the start of the current year - 74.
  • isShowWeekends (Boolean): Whether to show weekends.
  • isShowHolidays (Boolean): Whether to show holidays.
  • holidays (Array): An array of holidays.
  • holidayColor (String): Color of holidays (hex/rgb/rgba string). Default is #E1E1E1

Holidays Prop Example:

export const Holidays: HolidayType[] = [
  { name: 'День Конституции', month: 3, day: 15 },
  { name: 'День единения народов Беларуси и России', month: 4, day: 2 },
  { name: 'День Победы', month: 5, day: 9 },
  { name: 'День Независимости Республики Беларусь (День Республики)', month: 7, day: 3 },
  { name: 'День народного единства', month: 9, day: 17 },
  { name: 'Новый год', month: 1, day: 1 },
  { name: 'День защитников Отечества и Вооруженных Сил Республики Беларусь', month: 2, day: 23 },
  { name: 'День женщин', month: 3, day: 8 },
  { name: 'Праздник труда', month: 3, day: 1 },
  { name: 'День Октябрьской революции', month: 11, day: 7 },
  { name: 'Рождество Христово (православное Рождество)', month: 1, day: 7 },
  { name: 'Рождество Христово (католическое Рождество)', month: 12, day: 25 },
];

MaxRangeDate / MinRangeDate Prop Example:

minRangeDate = { year: new Date().getFullYear() - 74, month: 12, day: 1 },
maxRangeDate = { year: new Date().getFullYear() + 74, month: 12, day: 1 },

Installation Steps

  1. First, you need to install the library:
npm install @vmang0/datepicker-lib

or

yarn add @vmang0/datepicker-lib
  1. In general, you can already use input and calendar to work with dates. For example:
import { DatePicker, RangeDatePicker, TaskCalendar } from '@vmang0/datepicker-lib';

<DatePicker />
<RangeDatePicker />
<TaskCalendar />

Screenshots:

1. Range Datepicker

2. Default Datepicker

3. Task Calendar