It is carefully crafted based on native JavaScript and is compatible with all major browsers including IE6. It has elegant internal code, good performance experience, and a complete skin system, and it is completely open source. You can get the source code of the development version at will, and sweep away the closed and narrow nature of some traditional date controls. In line with the developer spirit of resource sharing and the endless pursuit of web calendar interaction, layDate continues the simplicity and ease of use of layui. She is under the LGPL license and you can use her for any personal project for free.
-
VersionLayDate 1.1
Online instance
Instance preview layDate - js date control and time plugin demo
Instance preview layDate date picker instance DEMO
import file
- <scriptsrc="laydate.js"></script>
Instructions
- <inputid="hello"class="laydate-icon">
- <script>
- laydate ({
- item : '#hello' ,
- event:'focus'
- });
- </script>
Parameter Description
1. The core method: laydate(options);
- options is an object containing the following keys : 'default' elem : '#id' ,
- //The element selector that needs to display the date
- event:'click',
- //trigger event
- format:'YYYY-MM-DD hh:mm:ss',
- //date format
- istime : false ,
- //Whether to enable time selection
- isclear:true,
- //whether to show clear
- istoday:true,
- //whether to display today
- issure:true,
- Whether to display the confirmation festival : true //whether to display the festival
- min : '1900-01-01 00:00:00' ,
- //minimum date
- max:'2099-12-31 23:59:59',
- // max date
- start: '2014-6-15 23:00:00',
- //开始日期
- fixed: false,
- //是否固定在可视区域
- zIndex: 99999999,
- //css z-index
- choose: function(dates) { //选择好日期的回调
- }
二、其它方法/属性
- laydate.v //获取laydate版本号
- laydate.skin(lib); //加载皮肤,参数lib为皮肤名
- /*
- layer.now支持多类型参数。timestamp可以是前后若干天,也可以是一个时间戳。format为日期格式,为空时则采用默认的“-”分割。
- 如laydate.now(-2)将返回前天,laydate.now(3999634079890)将返回2096-09-28
- */
- layer.now(timestamp, format); //该方法提供了丰富的功能,推荐灵活使用。
- laydate.reset(); //重设日历控件坐标,一般用于页面dom结构改变时。无参