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

@emreygc7/react-basic-calendar

v1.0.1

Published

"Simple and user-friendly calendar package."

Downloads

22

Readme

@emreygc7/react-basic-calendar

Simple and user-friendly calendar package for your React application.

Features

  • Capture the days, months, and years. 📆
  • Assign events to the days. 🎉
  • Drag & Drop events 💧
  • Dynamic styling. ✨
  • Language support. 🌐
  • No need for moment.js or day.js. ✖️

Installation

npm install @emreygc7/react-basic-calendar

Usage

First, include the package in your project. Then, call it within the component you want to use.

import React from React; 
import Calendar from '@emreygc7/react-basic-calendar'

function Home(){
    return(
	    <Calendar
	         startingDate={new Date()}
		 onDateClick={(date) => console.log(date)}
	    /> 
    )
}

startingDate

The value you pass to this prop will set the starting date of the calendar. For example: new Date(2020, 10, 12) //default new Date()

onDateClick

This prop captures the date you click on and returns a "date" object. You can find the information about the clicked date in the content of this object and use it as needed.

User Guide

Props

|Prop name|Description|Default Value|Example usage| |--|--|--|--| |language| Changes the language of the calendar. Available languages: "en", "tr", "es", "fr", "de", "it", "pt", "ru". |"en"| language={'tr'} | |startingDate|The value you pass to this prop will set the starting date of the calendar.|new Date()| new Date(2020,10,12)| |onDateClick|This prop captures the date you click on and returns a "date" object. You can find the information about the clicked date in the content of this object and use it as needed.|n/a| (date) => console.log(date) | |events|The events prop accepts an array as its content. The objects in the array have three keys: "date, title, id". If the objects in the array you pass to this prop do not have these keys, you need to customize them when passing.|n/a|[{date: '2023-05,20', title: 'Event 1', id: '1'}]| |onEventClick|This prop captures the event you click on and returns an "event" object. You can find the information about the clicked event in the content of this object and use it as needed.|n/a| (event) => console.log(event) | |customPrevIcon|The 'customPrevIcon' prop accepts an HTML or JSX element that will be rendered instead of the default prev icon. If you pass an invalid value (such as a string), it will automatically create an element and render the value you passed - which is not recommended|n/a| <button>Prev</button> or <FaPrevIcon /> | |customNextIcon|The 'customNextIcon' prop accepts an HTML or JSX element that will be rendered instead of the default next icon. If you pass an invalid value (such as a string), it will automatically create an element and render the value you passed - which is not recommended|n/a| <button>Next</button> or <MdNextIcon /> | |eventIsDraggable|The 'eventIsDraggable' prop determines whether the events assigned to the calendar have the drag-and-drop feature |false| true | |onEventDragEnd|The 'onEventDragEnd' prop returns two objects that contain the dragged event and the target date information. targetDate, event This allows you to update the date of the event asynchronously or synchronously in the function passed to this prop. |n/a| (targetDate, event) => console.log("target date: " targetDate, "selected Event: " event) |

Custom Style

You can completely change the appearance of the calendar using the props provided below. However, please note that each prop you use will completely override the default style files set for the calendar, rather than adding to them. Therefore, you are free to create your own style!

|Prop name| |--| |mainWrapperClassNames| |headWrapperClassNames| |daysWrapperClassNames| |daysClassNames| |calendarBodyClassNames| |bodyDaysClassNames| |eventClassNames|

What's next ?

  • More language support
  • Built-in dark mode support

License

MIT License.