🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

l_calendar

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

l_calendar

this is a calendar component for mobile

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

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'//最大日期 注意:该值会覆盖标签内定义的日期范围
});
...

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

Keywords

calendar

FAQs

Package last updated on 08 Nov 2017

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