GithubHelp home page GithubHelp logo

jiajia0524 / datepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jawil/datepicker

0.0 1.0 0.0 76 KB

仿滴滴出行预约打车IOS风格3D时间选择器 🌲

License: MIT License

JavaScript 78.46% CSS 12.92% HTML 8.61%

datepicker's Introduction

仿滴滴预约打车IOS风格时间选择器在线预览地址(PC请切换到移动端模式打开)

http://codepen.io/jawil/full/WRBxya/

 * [datePicker plugin]
 * IOS风格日期选择器,仿滴滴打车预约用车时间选择器
 * @Author  jawil
 * @date    2017-02-17
 * @param   {[object]}   options [配置参数]

运行预览

  1. cd datePicker
  2. npm install
  3. npm run dev(浏览器预览)
  4. npm run build(生成dist目录)

示例:

// UMD兼容规范,支持浏览器直接引入,require,define等多种JS模块化引入
<script src="dist/date-picker.min.js"></script>

datePicker({
    afterDay: 0, // 第几天后开始可以预约,默认是今天
    
    appointDays: 7, // 默认可以预约未来7天
    
    minuteLater: 20, // 当天的话,默认只能预约20分钟之后,如果两个小时就填120
    
    hourArea: [9, 22], // 预约小时可选的范围,默认是9:00-22:00
    
    interval: 1, // 分钟的间隔,默认一分钟
    initStrDate:'', //初始化时间 2018-12-25: 18:00:00
    callBack: function(timeStr, timeStamp) { // 点击确认获取到的时间戳和时间字符串
        console.log(timeStr, timeStamp)
    }
    
})

点击确认之后,回到函数callback可以拿到选择的时间字符串和时间戳。

效果图

有问题可以邮件联系我,欢迎提Issue和Pre

datepicker's People

Contributors

jawil avatar moyuanhui avatar

Watchers

 avatar

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.