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

@nikitos32/date-picker-library

v1.0.25

Published

Modsen Date Picker Library with different types of Calendars

Downloads

1,624

Readme

Modsen DatePicker

Сontent

Functionality:

  • Viewing the calendar;
  • Selecting a range for the calendar;
  • Default calendar with a preset range;
  • The ability to choose the beginning of the week (from Monday or Sunday);
  • Select the type of calendar (by week, month, etc.);
  • When you click on a certain day, the task list is added and saved in localStorage;
  • The ability to switch to the previous(th)/next(th) week/month/year;
  • The ability to select the maximum date of the calendar;
  • The ability to select the minimum date for the calendar;
  • The ability to hide/show weekends and highlight holidays in a different color;
  • The ability to switch to the date entered by the user in the calendar;
  • The ability to skip a certain date to set the date and vice versa, use the date entered by the user in the application;

Installation:

Before installing, download and install Node.js. Node.js 10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command: npm i @nikitos32/date-picker-library

Usage

DayCalendar


<DayCalendar
  withTodos={false}
  handleOnClickDateInputValue={handleOnClickDateInputValue}
  datePickerInputValue={startDateValue}
  startDate={startDateValue}
  endDate={endDateValue}
/>

| Props | Type | Description | | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | withTodos | boolean | allows you to control todos section | | startDate | string | allows you to pass string that will be the start day in a range | | endDate | string | allows you to pass string that will be the end day in a range | | handleOnClickDateInputValue | (date: string, inputId: string) => void) | allows you to set Day click handle | | shiftIndex | 1(from Sunday) or 2(from Monday) | allows you to handle from what day the week will start | | dayStyle | {dayColor: string, dayBackgroundColor: string} | allows you to handle day styling | | calendarWrapperStyle | { wrapperBackgroundColor?: string, wrapperBorderColor?: string, wrapperWidth?: string, wrapperHeight?: string} | allows you to handle calendar wrapper styling | | withMonth, withWeek, withYear, withHolidays | boolean | decide display section or not | | datePickerInputValue | string | provide default value to day calendar |

DatePicker


const [value, setValue] = useState("2024-12-09");

 const onChange = (e: ChangeEvent<HTMLInputElement>) => {
    setValue(e.target.value);
  };

 const onClear = () => {
    setValue("");
  };

  const onClickDay = (date: string) => {
    setValue(date);
  };

<DatePicker
  value={value}
  onChange={onChange}
  onClear={onClear}
  onClickDay={onClickDay}
    />

| Props | Type | Description | | ---------- | --------------------------------------------------- | ----------------------------------------------------------------- | | value | string | provide a value to set controlled input | | onChange | (e: React.ChangeEvent<HTMLInputElement>) => void) | provide a onChange handler if you pass value value | | onClear | () => void | provide a onClear handler to controll clear functionality | | onClickDay | (date: string) => void | provide a onClickDay handler to controll dayClick functionality | | maxDate | string | pass max date for input | | minDate | string | pass min date for input |

RangePicker


<RangePicker
  minDate={minDate}
  maxDate={maxDate}
  startDate={startDateValue}
  endDate={endDateValue}
  shiftIndex={shiftIndex}
/>

| Props | Type | Description | | ---------- | ------------------------------- | ---------------------------------------- | | minDate | string | provide a value to set min date | | maxDate | string | provide a value to set max date | | startDate | string | provide a value to set start date | | endDate | string | provide a value to set end date | | shiftIndex | 1(from Sunday), 2(fromMonday) | decide from what day the week will start |

Using Technologies

  • node.js - is a software platform based on the V8 engine (translating JavaScript into machine code);
  • babel - a transpiler that converts code from one standard to another;
  • eslint - linter for JavaScript code;
  • prettier - a tool for auto-formatting code;
  • husky - a modern solution for managing Git hooks;
  • commitlint - is a tool that checks commit messages for compliance with generally accepted standards of their descriptions;
  • yarn - package manager;
  • rollup - ES module builder;
  • storybook - is a tool used to develop user interface components in isolation;
  • react - JavaScript library for creating user interfaces;
  • typescript - strongly typed language to reduce the number of potential bugs;
  • styled-components - react component styling system;
  • jest - framework for unit testing;
  • react testing library - is a library for integration testing.