jQuery LayDate date control

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.

  1. VersionLayDate 1.1

  2. Author: Xian Xinxian

  3. github

Online instance

Instance preview  layDate - js date control and time plugin demo

Instance preview  layDate date picker instance DEMO

import file

  1. <scriptsrc="laydate.js"></script> 
copy

Instructions

  1. <inputid="hello"class="laydate-icon">  
  2. <script>
  3. laydate ({
  4. item : '#hello' , 
  5. event:'focus' 
  6. });
  7. </script>
copy

Parameter Description

1. The core method: laydate(options);

  1. options is an object containing the following keys : 'default' elem : '#id' ,  
  2. //The element selector that needs to display the date
  3. event:'click', 
  4. //trigger event
  5. format:'YYYY-MM-DD hh:mm:ss', 
  6. //date format
  7. istime : false , 
  8. //Whether to enable time selection
  9. isclear:true, 
  10. //whether to show clear
  11. istoday:true, 
  12. //whether to display today
  13. issure:true, 
  14. Whether to display the confirmation festival : true //whether to display the festival  
  15. min : '1900-01-01 00:00:00' , 
  16. //minimum date
  17. max:'2099-12-31 23:59:59', 
  18. // max date
  19. start: '2014-6-15 23:00:00',
  20. //开始日期
  21. fixed: false,
  22. //是否固定在可视区域
  23. zIndex: 99999999,
  24. //css z-index
  25. choose: function(dates) { //选择好日期的回调
  26. }
复制

二、其它方法/属性

  1. laydate.//获取laydate版本号
  2. laydate.skin(lib); //加载皮肤,参数lib为皮肤名 
  3. /*
  4.         layer.now支持多类型参数。timestamp可以是前后若干天,也可以是一个时间戳。format为日期格式,为空时则采用默认的“-”分割。
  5.         如laydate.now(-2)将返回前天,laydate.now(3999634079890)将返回2096-09-28
  6.     */
  7. layer.now(timestamp, format); //该方法提供了丰富的功能,推荐灵活使用。
  8. laydate.reset(); //重设日历控件坐标,一般用于页面dom结构改变时。无参
复制

        

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327058712&siteId=291194637