GithubHelp home page GithubHelp logo

mohebifar / react-persian-datepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evandhq/react-persian-datepicker

6.0 2.0 2.0 1.13 MB

A Persian date-picker component for react.js

Home Page: https://evandhq.github.io/react-persian-datepicker/

License: MIT License

JavaScript 86.92% CSS 13.08%

react-persian-datepicker's Introduction

React Persian Date Picker 📆

gitcheese.com

Persian calendar and date picker components for React. This is an open source project made in @evandhq team.

See the demo.

React Persian Date Picker مجموعه‌ای از کامپوننت‌های ReactJS مورد نیاز جهت ایجاد ورود و نمایش تاریخ هجری شمسی است. این نرم‌افزار متن‌باز در ایوند توسعه یافته‌است.

نسخه نمایشی را اینجا ببینید.

Installation

Use npm to install the package:

npm install react-persian-datepicker --save

Usage

This package offers two components, Calendar and DatePicker. The first of which is a simple calendar that you can use in whichever way you want. The second one is an actual input with an input-ish behaviour.

This package uses moment-jalaali under the hood and all the values are basically moment objects.

Below is a basic example.

import React from 'react';
import { Calendar, DatePicker } from 'react-persian-datepicker';

const MyComponent = () => (
  <div>
    <div>
      {/* Calendar Component */}
      <Calendar />
    </div>
    
    <div>
      {/* Date Picker Component */}
      <DatePicker />
    </div>
  </div>
);

API Documentaion

Current API documentation for v3.0.2 is available and for more examples take a look at here.

Note that you need css-loader for /\.css$/ files enabled to have the styles working as we use css modules to put classnames in place. Otherwise, you'll have to pass an object of class names (like a css module) as styles prop. This way, you can develop your own stylesheet for the calendar according to the basic one. The only thing that you will need to do is to require the css file that you made and pass it as styles prop to either Calendar or DatePicker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.