n-calendar

0.0.3 • Public • Published

n-calendar

install

npm install n-calendar -S
yarn add n-calendar

how to use

import React, { Component } from "react";
import { Calendar } from "n-calendar";
import "n-calendar/lib/index.css";

function Item(props) {
  return (
    <div
      style={
        props.data[props.dayItem.date]
          ? {
              color: "red"
            }
          : null
      }
    >
      {props.dayItem.day}
    </div>
  );
}

export class Demo extends Component {
  render() {
    const data = {
      "2019-11-1": { name: "jay" },
      "2019-11-2": { name: "jay" }
    };
    return (
      <div>
        <Calendar
            data={data}
            firstWeek={1}
            component={Item}
        />
      </div>
    );
  }
}

export default Demo;

Readme

Keywords

none

Package Sidebar

Install

npm i n-calendar

Weekly Downloads

11

Version

0.0.3

License

MIT

Unpacked Size

18.7 kB

Total Files

16

Last publish

Collaborators

  • scorpionjay