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

datepicker-cmp

v0.1.5

Published

datepicker package

Downloads

4

Readme

Datepicker-Cmp React Component

Datepicker-Cmp is a versatile and customizable React component for selecting dates. It provides a date input field along with a date picker modal that allows users to pick a date from a calendar. This component offers various customization options for styling and behavior.

Prerequisites

To use the SelectMenu component in your React application, you need:

  1. To have node Node : ^16.15.1

  2. To have install tailwindcss : https://tailwindcss.com/docs/installation/framework-guides

Installation

  1. You can install the datepicker-cmp package via npm:
npm install datepicker-cmp
  1. Your tailwin.config.js should be like this :

    /** @type {import('tailwindcss').Config} */
     export default {
     content: [
         "./index.html",
         "./src/**/*.{js,ts,jsx,tsx}",
         './node_modules/datepicker-cmp/**/*.{js,ts,jsx,tsx}',
     ],
     theme: {
         extend: {},
     },
     plugins: [],
     }

Usage

DatePicker Component

The DatePicker component is used to display a date input field and a date picker modal. It accepts the following props:

  • id (string): A unique identifier for the component.
  • selectedDate (string): The selected date in the format 'YYYY-MM-DD'.
  • minYear (number, optional): The minimum selectable year in the date picker.
  • substractionYears (number, optional): The number of years to subtract from the current year for the maxYear calculation.
  • zIndex (string): The z-index CSS property for the component.
  • isError (boolean): Indicates whether there is an error with the date (true) or not (false).
  • setter (function): A function to update the selected date.
  • backgroundColor (string, optional): The background color of the date input field.
  • backgroundColorDropdown (string, optional): The background color of the date picker modal.
  • textColor (string, optional): The text color of both the input field and the modal.
  • borderColor (string, optional): The border color of the input field.
  • width (string, optional): The width of the date input field.
  • height (string, optional): The height of the date input field.

Example usage:

import { DatePicker } from 'datepicker-cmp';

const App = () => {
  const id = 'datepicker';
  const selectedDate = '2023-10-06';
  const minYear = 1900;
  const substractionYears = 100;
  const zIndex = '100';
  const isError = false;

  const handleDateChange = (newDate) => {
    // Handle date change logic here
  };

  return (
    <DatePicker
      id={id}
      selectedDate={selectedDate}
      minYear={minYear}
      substractionYears={substractionYears}
      zIndex={zIndex}
      isError={isError}
      setter={handleDateChange}
      backgroundColor="transparent"
      backgroundColorDropdown="white"
      textColor="#000"
      borderColor="#ccc"
      width="370px"
      height="45px"
    />
  );
};

PropTypes

Please refer to the PropTypes documentation for the DatePicker component above for information on the expected prop types and their default values.

Node Version

The datepicker-cmp package requires Node.js version ^16.15.1 to work correctly.

License

This package is distributed under the MIT License. Feel free to use and customize it to suit your needs.

If you encounter any issues or have suggestions for improvements, please open an issue on GitHub. We appreciate your feedback!