Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

baidu-calendar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baidu-calendar

基于react实现的百度日历组件

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

baidu-calendar (一款仿百度日历组件,react 版本)

baidu-calendar

基于 react+react-hooks 实现的百度日历组件。宜忌算法尚未实现,欢迎 pr。

vue3版:https://github.com/qiuquanwu/vue-baidu-calendar

在线demo

因为react版本问题

先安装react-select

$ npm install react-select --save

再安装

$ npm install baidu-calendar --save

使用

App.jsx

import React, { useState } from "react";
import BaiduCalendar from "baidu-calendar";
import "./App.css";
function App() {
  //设定日期,必填
  let [date, setDate] = useState("2021-2-5");
  //设定年份范围
  let [range, setRange] = useState([2015, 2026]);
  //时间监听,必传
  const change = (obj) => {
    console.log(obj);
  };
  return (
    <div className="app">
      <BaiduCalendar date={date} range={range} change={change} />
    </div>
  );
}

export default App;

演示

Keywords

FAQs

Package last updated on 06 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc