Giter Site home page Giter Site logo

datepicker's Introduction

Date Picker

  • 轻量,压缩后9KB,GZIP后4KB
  • 无依赖,不依赖第三方框架,不依赖图片样式,引入datepicker.min.js即可
  • 易用,只需将input的type设置为date

截图

screenshot

1、引入datepicker.min.js

<script src="datepicker.min.js"> </script>

2、设置input的type为date

<input type="date"/>

3、获取输入的时间

var element = document.getElementById("你的输入元素id");

//时间戳
var timestamp = element.getAttribute("timestamp")

//字符串
var str = element.value;

设置起始时间

禁止选择指定时间之前的日期

<input type="date" begin="1411546602913"/>

设置结束时间

禁止选择指定时间之后的日期

<input type="date" end="1411546602913"/>

时间组合

前面选择的结果作为后续选择器的起始时间,靠后选择的结果作为之前选择器的结束时间

<input type="date" group="groupname"/>
至
<input type="date" group="groupname"/>

重新初始化

当页面结构非直出或页面结构发生改变时,通知组件重新初始化

var datepicker = require("datepicker");
datepicker.trigger();

或者

qdp.trigger();

License

MIT

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.