GithubHelp home page GithubHelp logo

lee66 / lcalendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xfhxbb/lcalendar

0.0 2.0 0.0 97 KB

LCalendar移动端日期时间选择控件

License: MIT License

CSS 9.15% HTML 7.53% JavaScript 83.32%

lcalendar's Introduction

LCalendar v1.71移动端日期时间选择控件

纯原生js的移动端日期插件,不依赖任何库,体积非常小只有10k ##用法 在html页面中引入input标签,通过自定义属性data-lcalendar控制最小日期和最大日期,写法如下:

...
<input type="text" readonly="" name="input_date" placeholder="请输入日期" data-lcalendar="2000-01-01,2018-01-29" />
...

将样式文件引入到页面中:

...
<link rel="stylesheet" href="LCalendar.css">
...

同时引入js文件到页面中:

...
<script src="LCalendar.js"></script>
...

初始化插件:

...
var calendar = new LCalendar();
calendar.init({
    'trigger': '#demo1',//标签id
    'type': 'date',//date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择
    'minDate':'1900-1-1',//最小日期 注意:该值会覆盖标签内定义的日期范围
    'maxDate':'2016-3-18'//最大日期 注意:该值会覆盖标签内定义的日期范围
});
...

调用起来非常简单,代码我后续会持续优化,如果喜欢希望赏颗星哦。

lcalendar's People

Contributors

xfhxbb avatar

Watchers

 avatar  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.