Giter VIP home page Giter VIP logo

react-week-time-range-picker's Introduction

react-week-time-range-picker

用法 | usage

npm install react-week-time-range-picker --save-dev

// jsx/tsx
import ReactWeekTimeRangePicker from 'react-week-time-range-picker'

const Test = () => {
  // 获取选中的值
  const handleSelectTimeRange = (selectedData) => {
    console.log(selectedData)
  }
}
<react-week-time-range-picker hasHalfHour={true} selectedData={[]} selectTimeRange={handleSelectTimeRange} />

API

interface ReactWeekTimeRangePickerProps {
  hasHalfHour?: boolean; // true | false (默认带半小时 | default with half-hour)
  selectedData?: SelectedDataProps[];
  selectTimeRange?: (checked: SelectedDataProps[]) => void // 接收选中的时间 | receive selected time
}

// selectedData 数据结构/Data Structures
[
  {
    iden: '3',
    mergeTimes: [['02:30', '03:00']],
    times: ['02:30'],
    week: '星期四'
  }
]

图示

vue-week-time-range-picker

兼容性 | compatible

chrome
version 77

注意

  1. 测试发现,edge浏览器中会受margin和padding影响,从而导致框选有偏差,建议不要对其父元素使用margin和padding。
  2. 测试发现,直接引入时,左侧偏移位置有出入,目前修复,待反馈。
  3. react hooks写的组件发包大坑啊,看这个issue 17014还有这个解决方法:solution

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.