Compare commits
No commits in common. "master" and "v1" have entirely different histories.
|
@ -1,20 +0,0 @@
|
|||
*.iml
|
||||
.idea/
|
||||
.ipr
|
||||
.iws
|
||||
*~
|
||||
~*
|
||||
*.diff
|
||||
*.patch
|
||||
*.bak
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.svn/
|
||||
*.swp
|
||||
.nojekyll
|
||||
.project
|
||||
.settings/
|
||||
node_modules/
|
||||
_site/
|
||||
release/
|
||||
.npmignore
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
# [更新日志](http://www.layui.com/laydate/changelog.html)
|
||||
|
21
LICENSE
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2016 layui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
25
README.md
|
@ -1,9 +1,22 @@
|
|||
## 说明
|
||||
1. laydate.js是压缩后的核心代码,laydate.dev.js是开发版的源代码。
|
||||
1. need目录存放着核心css
|
||||
1. skins是皮肤目录
|
||||
1. 将laydate pull到你的本地后,将其存放到您js相关目录下的laydate目录,不要改动laydate的结构,否则无法正常运行。
|
||||
|
||||
## 概要
|
||||
一款被广泛使用的高级 Web 日历组件,颜值与功能兼备,足以应对日期相关的各种业务场景。其中主要以:年选择器、年月选择器、日期选择器、时间选择器、日期时间选择五种类型的选择方式为基本核心,并且均支持范围选择(即双控件)。内置强劲的自定义日期格式解析和合法校正机制,含中文版和国际版,主题简约却又不失灵活多样。内部采用是零依赖的原生 JavaScript 编写,可作为独立组件使用。
|
||||
## 简要
|
||||
她基于原生JavaScript精心雕琢,兼容了包括IE6在内的所有主流浏览器。她具备优雅的内部代码,良好的性能体验,和完善的皮肤体系,并且完全开源,你可以任意获取开发版源代码,一扫某些传统日期控件的封闭与狭隘。layDate本着资源共享的开发者精神和对网页日历交互无穷的追求,延续了layui一贯的简单与易用。她遵循LGPL协议,您可以免费将她用于任何个人项目。
|
||||
|
||||
## 官网
|
||||
[http://www.layui.com/laydate/](http://www.layui.com/laydate/)
|
||||
## 更新日志
|
||||
|
||||
## 相关
|
||||
[文档](http://www.layui.com/doc/modules/laydate.html)
|
||||
1.1
|
||||
|
||||
1. layer.now(timestamp,format)支持多类型参数。timestamp支持今天的前若干天,和今天的后若干天,并且如果是一个有效的时间戳,则返回该时间戳对应的日期。如果什么都没传入,则返回当前时间日期。format为日期格式,为空时则采用默认的“-”分割。
|
||||
2. 优化核心代码。
|
||||
3. 分和秒的选择改成10列*6行。
|
||||
4. 修复星期未居中对齐的样式问题
|
||||
5. 修复在页面加载完毕事件中,调用laydate所造成的立即执行的bug
|
||||
6. 皮肤包新增[墨绿]。
|
||||
|
||||
## 备注
|
||||
[官网](http://laydate.layui.com/)、[社区](http://fly.layui.com/)
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2013-9-30: Created.
|
||||
-->
|
||||
<svg>
|
||||
<metadata>
|
||||
Created by iconfont
|
||||
</metadata>
|
||||
<defs>
|
||||
|
||||
<font id="laydate-icon" horiz-adv-x="1024" >
|
||||
<font-face
|
||||
font-family="laydate-icon"
|
||||
font-weight="500"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
|
||||
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
|
||||
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
|
||||
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
|
||||
|
||||
|
||||
|
||||
<glyph glyph-name="youyou" unicode="" d="M283.648 721.918976 340.873216 780.926976 740.352 383.997952 340.876288-12.925952 283.648 46.077952 619.52 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="zuozuo" unicode="" d="M740.352 721.918976 683.126784 780.926976 283.648 383.997952 683.123712-12.925952 740.352 46.077952 404.48 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye" unicode="" d="M62.573 384.103l423.401 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.751-18.976-68.727 0l-39.753 39.753 0.269 0.246-385.655 385.661zM451.365 384.103l423.407 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.757-18.977-68.727 0l-39.762 39.754 0.273 0.249-385.662 385.661zM451.365 384.103z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye1" unicode="" d="M948.066926 382.958838l-411.990051-412.24426c-18.47333-18.47333-48.417689-18.47333-66.875207 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L814.691135 383.088983 467.512212 730.269123c-18.466032 18.458735-18.466032 48.405526 0 66.873991 18.468465 18.464816 48.410391 18.464816 66.872774 0l38.682336-38.682336-0.261507-0.239614 375.259894-375.265975v0.003649m-378.312834 0L157.756743-29.285422c-18.47333-18.47333-48.415256-18.47333-66.872775 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L436.369787 383.088983 89.19208 730.269123c-18.4636 18.458735-18.4636 48.405526 0 66.873991 18.470898 18.464816 48.415256 18.464816 66.872774 0l38.692067-38.682336-0.266372-0.239614 375.267191-375.265975-0.004865 0.003649m0 0z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
</defs></svg>
|
Before Width: | Height: | Size: 3.0 KiB |
72
gulpfile.js
|
@ -1,72 +0,0 @@
|
|||
|
||||
/*!
|
||||
* laydate build
|
||||
*/
|
||||
|
||||
var pkg = require('./package.json');
|
||||
|
||||
var gulp = require('gulp');
|
||||
var uglify = require('gulp-uglify');
|
||||
var minify = require('gulp-minify-css');
|
||||
var rename = require('gulp-rename');
|
||||
var header = require('gulp-header');
|
||||
var del = require('del');
|
||||
|
||||
//发行版本目录
|
||||
var releaseDir = './release/zip/layDate-v' + pkg.version;
|
||||
var release = releaseDir + '/laydate';
|
||||
|
||||
var task = {
|
||||
laydate: function() {
|
||||
gulp.src('./src/**/*.css')
|
||||
.pipe(minify({
|
||||
compatibility: 'ie7'
|
||||
}))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
|
||||
return gulp.src('./src/laydate.js').pipe(uglify({
|
||||
output: {
|
||||
ascii_only: true //escape Unicode characters in strings and regexps
|
||||
}
|
||||
}))
|
||||
.pipe(header('/*! <%= pkg.realname %> v<%= pkg.version %> | <%= pkg.description %> | <%= pkg.license %> Licensed */\n ;', {pkg: pkg}))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
|
||||
}
|
||||
,other: function(){
|
||||
gulp.src('./src/**/font/*').pipe(rename({}))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
gulp.task('clear', function(cb){ //清理
|
||||
return del(['./dist/*'], cb);
|
||||
});
|
||||
gulp.task('laydate', task.minjs); //压缩PC版本
|
||||
gulp.task('other', task.other); //移动一些配件
|
||||
|
||||
//打包发行版
|
||||
gulp.task('clearZip', function(cb){ //清理
|
||||
return del(['./release/zip/layDate-v'+ pkg.version], cb);
|
||||
});
|
||||
gulp.task('r', ['clearZip'], function(){
|
||||
gulp.src('./release/doc/**/*')
|
||||
.pipe(gulp.dest(releaseDir))
|
||||
|
||||
return gulp.src('./dist/**/*')
|
||||
.pipe(gulp.dest(releaseDir + '/laydate'))
|
||||
});
|
||||
|
||||
//全部
|
||||
gulp.task('default', ['clear'], function(){
|
||||
for(var key in task){
|
||||
task[key]();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,932 @@
|
|||
/**
|
||||
|
||||
@Name : layDate v1.1 日期控件
|
||||
@Author: 贤心
|
||||
@Date: 2014-06-25
|
||||
@QQ群:176047195
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
*/
|
||||
|
||||
;!function(win){
|
||||
|
||||
//全局配置,如果采用默认均不需要改动
|
||||
var config = {
|
||||
path: '', //laydate所在路径
|
||||
skin: 'default', //初始化皮肤
|
||||
format: 'YYYY-MM-DD', //日期格式
|
||||
min: '1900-01-01 00:00:00', //最小日期
|
||||
max: '2099-12-31 23:59:59', //最大日期
|
||||
isv: false,
|
||||
init: true
|
||||
};
|
||||
|
||||
var Dates = {}, doc = document, creat = 'createElement', byid = 'getElementById', tags = 'getElementsByTagName';
|
||||
var as = ['laydate_box', 'laydate_void', 'laydate_click', 'LayDateSkin', 'skins/', '/laydate.css'];
|
||||
|
||||
|
||||
//主接口
|
||||
win.laydate = function(options){
|
||||
options = options || {};
|
||||
try{
|
||||
as.event = win.event ? win.event : laydate.caller.arguments[0];
|
||||
} catch(e){};
|
||||
Dates.run(options);
|
||||
return laydate;
|
||||
};
|
||||
|
||||
laydate.v = '1.1';
|
||||
|
||||
//获取组件存放路径
|
||||
Dates.getPath = (function(){
|
||||
var js = document.scripts, jsPath = js[js.length - 1].src;
|
||||
return config.path ? config.path : jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
|
||||
}());
|
||||
|
||||
Dates.use = function(lib, id){
|
||||
var link = doc[creat]('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = Dates.getPath + lib + as[5];
|
||||
id && (link.id = id);
|
||||
doc[tags]('head')[0].appendChild(link);
|
||||
link = null;
|
||||
};
|
||||
|
||||
Dates.trim = function(str){
|
||||
str = str || '';
|
||||
return str.replace(/^\s|\s$/g, '').replace(/\s+/g, ' ');
|
||||
};
|
||||
|
||||
//补齐数位
|
||||
Dates.digit = function(num){
|
||||
return num < 10 ? '0' + (num|0) : num;
|
||||
};
|
||||
|
||||
Dates.stopmp = function(e){
|
||||
e = e || win.event;
|
||||
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
Dates.each = function(arr, fn){
|
||||
var i = 0, len = arr.length;
|
||||
for(; i < len; i++){
|
||||
if(fn(i, arr[i]) === false){
|
||||
break
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Dates.hasClass = function(elem, cls){
|
||||
elem = elem || {};
|
||||
return new RegExp('\\b' + cls +'\\b').test(elem.className);
|
||||
};
|
||||
|
||||
Dates.addClass = function(elem, cls){
|
||||
elem = elem || {};
|
||||
Dates.hasClass(elem, cls) || (elem.className += ' ' + cls);
|
||||
elem.className = Dates.trim(elem.className);
|
||||
return this;
|
||||
};
|
||||
|
||||
Dates.removeClass = function(elem, cls) {
|
||||
elem = elem || {};
|
||||
if (Dates.hasClass(elem, cls)) {
|
||||
var reg = new RegExp('\\b' + cls +'\\b');
|
||||
elem.className = elem.className.replace(reg, '');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
//清除css属性
|
||||
Dates.removeCssAttr = function(elem, attr){
|
||||
var s = elem.style;
|
||||
if(s.removeProperty){
|
||||
s.removeProperty(attr);
|
||||
} else {
|
||||
s.removeAttribute(attr);
|
||||
}
|
||||
};
|
||||
|
||||
//显示隐藏
|
||||
Dates.shde = function(elem, type){
|
||||
elem.style.display = type ? 'none' : 'block';
|
||||
};
|
||||
|
||||
//简易选择器
|
||||
Dates.query = function(node){
|
||||
if(node && node.nodeType === 1){
|
||||
if(node.tagName.toLowerCase() !== 'input'){
|
||||
throw new Error('选择器elem错误');
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
var node = (Dates.trim(node)).split(' '), elemId = doc[byid](node[0].substr(1)), arr;
|
||||
if(!elemId){
|
||||
return;
|
||||
} else if(!node[1]){
|
||||
return elemId;
|
||||
} else if(/^\./.test(node[1])){
|
||||
var find, child = node[1].substr(1), exp = new RegExp('\\b' + child +'\\b');
|
||||
arr = []
|
||||
find = doc.getElementsByClassName ? elemId.getElementsByClassName(child) : elemId[tags]('*');
|
||||
Dates.each(find, function(ii, that){
|
||||
exp.test(that.className) && arr.push(that);
|
||||
});
|
||||
return arr[0] ? arr : '';
|
||||
} else {
|
||||
arr = elemId[tags](node[1]);
|
||||
return arr[0] ? elemId[tags](node[1]) : '';
|
||||
}
|
||||
};
|
||||
|
||||
//事件监听器
|
||||
Dates.on = function(elem, even, fn){
|
||||
elem.attachEvent ? elem.attachEvent('on'+ even, function(){
|
||||
fn.call(elem, win.even);
|
||||
}) : elem.addEventListener(even, fn, false);
|
||||
return Dates;
|
||||
};
|
||||
|
||||
//阻断mouseup
|
||||
Dates.stopMosup = function(evt, elem){
|
||||
if(evt !== 'mouseup'){
|
||||
Dates.on(elem, 'mouseup', function(ev){
|
||||
Dates.stopmp(ev);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Dates.run = function(options){
|
||||
var S = Dates.query, elem, devt, even = as.event, target;
|
||||
try {
|
||||
target = even.target || even.srcElement || {};
|
||||
} catch(e){
|
||||
target = {};
|
||||
}
|
||||
elem = options.elem ? S(options.elem) : target;
|
||||
|
||||
as.elemv = /textarea|input/.test(elem.tagName.toLocaleLowerCase()) ? 'value' : 'innerHTML';
|
||||
if (('init' in options ? options.init : config.init) && (!elem[as.elemv])) elem[as.elemv] = laydate.now(null, options.format || config.format);
|
||||
|
||||
if(even && target.tagName){
|
||||
if(!elem || elem === Dates.elem){
|
||||
return;
|
||||
}
|
||||
Dates.stopMosup(even.type, elem);
|
||||
Dates.stopmp(even);
|
||||
Dates.view(elem, options);
|
||||
Dates.reshow();
|
||||
} else {
|
||||
devt = options.event || 'click';
|
||||
Dates.each((elem.length|0) > 0 ? elem : [elem], function(ii, that){
|
||||
Dates.stopMosup(devt, that);
|
||||
Dates.on(that, devt, function(ev){
|
||||
Dates.stopmp(ev);
|
||||
if(that !== Dates.elem){
|
||||
Dates.view(that, options);
|
||||
Dates.reshow();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chgSkin(options.skin || config.skin)
|
||||
};
|
||||
|
||||
Dates.scroll = function(type){
|
||||
type = type ? 'scrollLeft' : 'scrollTop';
|
||||
return doc.body[type] | doc.documentElement[type];
|
||||
};
|
||||
|
||||
Dates.winarea = function(type){
|
||||
return document.documentElement[type ? 'clientWidth' : 'clientHeight']
|
||||
};
|
||||
|
||||
//判断闰年
|
||||
Dates.isleap = function(year){
|
||||
return (year%4 === 0 && year%100 !== 0) || year%400 === 0;
|
||||
};
|
||||
|
||||
//检测是否在有效期
|
||||
Dates.checkVoid = function(YY, MM, DD){
|
||||
var back = [];
|
||||
YY = YY|0;
|
||||
MM = MM|0;
|
||||
DD = DD|0;
|
||||
if(YY < Dates.mins[0]){
|
||||
back = ['y'];
|
||||
} else if(YY > Dates.maxs[0]){
|
||||
back = ['y', 1];
|
||||
} else if(YY >= Dates.mins[0] && YY <= Dates.maxs[0]){
|
||||
if(YY == Dates.mins[0]){
|
||||
if(MM < Dates.mins[1]){
|
||||
back = ['m'];
|
||||
} else if(MM == Dates.mins[1]){
|
||||
if(DD < Dates.mins[2]){
|
||||
back = ['d'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(YY == Dates.maxs[0]){
|
||||
if(MM > Dates.maxs[1]){
|
||||
back = ['m', 1];
|
||||
} else if(MM == Dates.maxs[1]){
|
||||
if(DD > Dates.maxs[2]){
|
||||
back = ['d', 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return back;
|
||||
};
|
||||
|
||||
//时分秒的有效检测
|
||||
Dates.timeVoid = function(times, index){
|
||||
if(Dates.ymd[1]+1 == Dates.mins[1] && Dates.ymd[2] == Dates.mins[2]){
|
||||
if(index === 0 && (times < Dates.mins[3])){
|
||||
return 1;
|
||||
} else if(index === 1 && times < Dates.mins[4]){
|
||||
return 1;
|
||||
} else if(index === 2 && times < Dates.mins[5]){
|
||||
return 1;
|
||||
}
|
||||
} else if(Dates.ymd[1]+1 == Dates.maxs[1] && Dates.ymd[2] == Dates.maxs[2]){
|
||||
if(index === 0 && times > Dates.maxs[3]){
|
||||
return 1;
|
||||
} else if(index === 1 && times > Dates.maxs[4]){
|
||||
return 1;
|
||||
} else if(index === 2 && times > Dates.maxs[5]){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if(times > (index ? 59 : 23)){
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
//检测日期是否合法
|
||||
Dates.check = function(){
|
||||
var reg = Dates.options.format.replace(/YYYY|MM|DD|hh|mm|ss/g,'\\d+\\').replace(/\\$/g, '');
|
||||
var exp = new RegExp(reg), value = Dates.elem[as.elemv];
|
||||
var arr = value.match(/\d+/g) || [], isvoid = Dates.checkVoid(arr[0], arr[1], arr[2]);
|
||||
if(value.replace(/\s/g, '') !== ''){
|
||||
if(!exp.test(value)){
|
||||
Dates.elem[as.elemv] = '';
|
||||
Dates.msg('日期不符合格式,请重新选择。');
|
||||
return 1;
|
||||
} else if(isvoid[0]){
|
||||
Dates.elem[as.elemv] = '';
|
||||
Dates.msg('日期不在有效期内,请重新选择。');
|
||||
return 1;
|
||||
} else {
|
||||
isvoid.value = Dates.elem[as.elemv].match(exp).join();
|
||||
arr = isvoid.value.match(/\d+/g);
|
||||
if(arr[1] < 1){
|
||||
arr[1] = 1;
|
||||
isvoid.auto = 1;
|
||||
} else if(arr[1] > 12){
|
||||
arr[1] = 12;
|
||||
isvoid.auto = 1;
|
||||
} else if(arr[1].length < 2){
|
||||
isvoid.auto = 1;
|
||||
}
|
||||
if(arr[2] < 1){
|
||||
arr[2] = 1;
|
||||
isvoid.auto = 1;
|
||||
} else if(arr[2] > Dates.months[(arr[1]|0)-1]){
|
||||
arr[2] = 31;
|
||||
isvoid.auto = 1;
|
||||
} else if(arr[2].length < 2){
|
||||
isvoid.auto = 1;
|
||||
}
|
||||
if(arr.length > 3){
|
||||
if(Dates.timeVoid(arr[3], 0)){
|
||||
isvoid.auto = 1;
|
||||
};
|
||||
if(Dates.timeVoid(arr[4], 1)){
|
||||
isvoid.auto = 1;
|
||||
};
|
||||
if(Dates.timeVoid(arr[5], 2)){
|
||||
isvoid.auto = 1;
|
||||
};
|
||||
}
|
||||
if(isvoid.auto){
|
||||
Dates.creation([arr[0], arr[1]|0, arr[2]|0], 1);
|
||||
} else if(isvoid.value !== Dates.elem[as.elemv]){
|
||||
Dates.elem[as.elemv] = isvoid.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//生成日期
|
||||
Dates.months = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
Dates.viewDate = function(Y, M, D){
|
||||
var S = Dates.query, log = {}, De = new Date();
|
||||
Y < (Dates.mins[0]|0) && (Y = (Dates.mins[0]|0));
|
||||
Y > (Dates.maxs[0]|0) && (Y = (Dates.maxs[0]|0));
|
||||
|
||||
De.setFullYear(Y, M, D);
|
||||
log.ymd = [De.getFullYear(), De.getMonth(), De.getDate()];
|
||||
|
||||
Dates.months[1] = Dates.isleap(log.ymd[0]) ? 29 : 28;
|
||||
|
||||
De.setFullYear(log.ymd[0], log.ymd[1], 1);
|
||||
log.FDay = De.getDay();
|
||||
|
||||
log.PDay = Dates.months[M === 0 ? 11 : M - 1] - log.FDay + 1;
|
||||
log.NDay = 1;
|
||||
|
||||
//渲染日
|
||||
Dates.each(as.tds, function(i, elem){
|
||||
var YY = log.ymd[0], MM = log.ymd[1] + 1, DD;
|
||||
elem.className = '';
|
||||
if(i < log.FDay){
|
||||
elem.innerHTML = DD = i + log.PDay;
|
||||
Dates.addClass(elem, 'laydate_nothis');
|
||||
MM === 1 && (YY -= 1);
|
||||
MM = MM === 1 ? 12 : MM - 1;
|
||||
} else if(i >= log.FDay && i < log.FDay + Dates.months[log.ymd[1]]){
|
||||
elem.innerHTML = DD = i - log.FDay + 1;
|
||||
if(i - log.FDay + 1 === log.ymd[2]){
|
||||
Dates.addClass(elem, as[2]);
|
||||
log.thisDay = elem;
|
||||
}
|
||||
} else {
|
||||
elem.innerHTML = DD = log.NDay++;
|
||||
Dates.addClass(elem, 'laydate_nothis');
|
||||
MM === 12 && (YY += 1);
|
||||
MM = MM === 12 ? 1 : MM + 1;
|
||||
}
|
||||
|
||||
if(Dates.checkVoid(YY, MM, DD)[0]){
|
||||
Dates.addClass(elem, as[1]);
|
||||
}
|
||||
|
||||
Dates.options.festival && Dates.festival(elem, MM + '.' + DD);
|
||||
elem.setAttribute('y', YY);
|
||||
elem.setAttribute('m', MM);
|
||||
elem.setAttribute('d', DD);
|
||||
YY = MM = DD = null;
|
||||
});
|
||||
|
||||
Dates.valid = !Dates.hasClass(log.thisDay, as[1]);
|
||||
Dates.ymd = log.ymd;
|
||||
|
||||
//锁定年月
|
||||
as.year.value = Dates.ymd[0] + '年';
|
||||
as.month.value = Dates.digit(Dates.ymd[1] + 1) + '月';
|
||||
|
||||
//定位月
|
||||
Dates.each(as.mms, function(i, elem){
|
||||
var getCheck = Dates.checkVoid(Dates.ymd[0], (elem.getAttribute('m')|0) + 1);
|
||||
if(getCheck[0] === 'y' || getCheck[0] === 'm'){
|
||||
Dates.addClass(elem, as[1]);
|
||||
} else {
|
||||
Dates.removeClass(elem, as[1]);
|
||||
}
|
||||
Dates.removeClass(elem, as[2]);
|
||||
getCheck = null
|
||||
});
|
||||
Dates.addClass(as.mms[Dates.ymd[1]], as[2]);
|
||||
|
||||
//定位时分秒
|
||||
log.times = [
|
||||
Dates.inymd[Dates.elemIndexMap.hour]|0 || 0,
|
||||
Dates.inymd[Dates.elemIndexMap.minute]|0 || 0,
|
||||
Dates.inymd[Dates.elemIndexMap.second]|0 || 0
|
||||
];
|
||||
Dates.each(new Array(3), function(i){
|
||||
Dates.hmsin[i].value = Dates.digit(Dates.timeVoid(log.times[i], i) ? Dates.mins[i+3]|0 : log.times[i]|0);
|
||||
});
|
||||
|
||||
//确定按钮状态
|
||||
Dates[Dates.valid ? 'removeClass' : 'addClass'](as.ok, as[1]);
|
||||
};
|
||||
|
||||
//节日
|
||||
Dates.festival = function(td, md){
|
||||
var str;
|
||||
switch(md){
|
||||
case '1.1':
|
||||
str = '元旦';
|
||||
break;
|
||||
case '3.8':
|
||||
str = '妇女';
|
||||
break;
|
||||
case '4.5':
|
||||
str = '清明';
|
||||
break;
|
||||
case '5.1':
|
||||
str = '劳动';
|
||||
break;
|
||||
case '6.1':
|
||||
str = '儿童';
|
||||
break;
|
||||
case '9.10':
|
||||
str = '教师';
|
||||
break;
|
||||
case '10.1':
|
||||
str = '国庆';
|
||||
break;
|
||||
};
|
||||
str && (td.innerHTML = str);
|
||||
str = null;
|
||||
};
|
||||
|
||||
//生成年列表
|
||||
Dates.viewYears = function(YY){
|
||||
var S = Dates.query, str = '';
|
||||
Dates.each(new Array(14), function(i){
|
||||
if(i === 7) {
|
||||
str += '<li '+ (parseInt(as.year.value) === YY ? 'class="'+ as[2] +'"' : '') +' y="'+ YY +'">'+ YY +'年</li>';
|
||||
} else {
|
||||
str += '<li y="'+ (YY-7+i) +'">'+ (YY-7+i) +'年</li>';
|
||||
}
|
||||
});
|
||||
S('#laydate_ys').innerHTML = str;
|
||||
Dates.each(S('#laydate_ys li'), function(i, elem){
|
||||
if(Dates.checkVoid(elem.getAttribute('y'))[0] === 'y'){
|
||||
Dates.addClass(elem, as[1]);
|
||||
} else {
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev).reshow();
|
||||
Dates.viewDate(this.getAttribute('y')|0, Dates.ymd[1], Dates.ymd[2]);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Dates.getEachElementIndex = function(format) {
|
||||
var components = {};
|
||||
var currentIndex = 0;
|
||||
format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index){
|
||||
if (str === 'YYYY') {
|
||||
components['year'] = currentIndex++;
|
||||
} else if (str === 'MM') {
|
||||
components['month'] = currentIndex++;
|
||||
} else if (str === 'DD') {
|
||||
components['day'] = currentIndex++;
|
||||
} else if (str === 'hh') {
|
||||
components['hour'] = currentIndex++;
|
||||
} else if (str === 'mm') {
|
||||
components['minute'] = currentIndex++;
|
||||
} else if (str === 'ss') {
|
||||
components['second'] = currentIndex++;
|
||||
}
|
||||
return "";
|
||||
});
|
||||
return components;
|
||||
};
|
||||
|
||||
//初始化面板数据
|
||||
Dates.initDate = function(format){
|
||||
var S = Dates.query, log = {}, De = new Date();
|
||||
var ymd = Dates.elem[as.elemv].match(/\d+/g) || [];
|
||||
var elemIndexMap = Dates.getEachElementIndex(format);
|
||||
Dates.elemIndexMap = elemIndexMap;
|
||||
if(ymd.length < 3){
|
||||
ymd = Dates.options.start.match(/\d+/g) || [];
|
||||
if(ymd.length < 3){
|
||||
ymd = [De.getFullYear(), De.getMonth()+1, De.getDate()];
|
||||
}
|
||||
}
|
||||
Dates.inymd = ymd;
|
||||
Dates.viewDate(ymd[elemIndexMap.year], ymd[elemIndexMap.month] - 1, ymd[elemIndexMap.day]);
|
||||
};
|
||||
|
||||
//是否显示零件
|
||||
Dates.iswrite = function(){
|
||||
var S = Dates.query, log = {
|
||||
time: S('#laydate_hms')
|
||||
};
|
||||
Dates.shde(log.time, !Dates.options.istime);
|
||||
Dates.shde(as.oclear, !('isclear' in Dates.options ? Dates.options.isclear : 1));
|
||||
Dates.shde(as.otoday, !('istoday' in Dates.options ? Dates.options.istoday : 1));
|
||||
Dates.shde(as.ok, !('issure' in Dates.options ? Dates.options.issure : 1));
|
||||
};
|
||||
|
||||
//方位辨别
|
||||
Dates.orien = function(obj, pos){
|
||||
var tops, rect = Dates.elem.getBoundingClientRect();
|
||||
obj.style.left = rect.left + (pos ? 0 : Dates.scroll(1)) + 'px';
|
||||
if(rect.bottom + obj.offsetHeight/1.5 <= Dates.winarea()){
|
||||
tops = rect.bottom - 1;
|
||||
} else {
|
||||
tops = rect.top > obj.offsetHeight/1.5 ? rect.top - obj.offsetHeight + 1 : Dates.winarea() - obj.offsetHeight;
|
||||
}
|
||||
obj.style.top = Math.max(tops + (pos ? 0 : Dates.scroll()),1) + 'px';
|
||||
};
|
||||
|
||||
//吸附定位
|
||||
Dates.follow = function(obj){
|
||||
if(Dates.options.fixed){
|
||||
obj.style.position = 'fixed';
|
||||
Dates.orien(obj, 1);
|
||||
} else {
|
||||
obj.style.position = 'absolute';
|
||||
Dates.orien(obj);
|
||||
}
|
||||
};
|
||||
|
||||
//生成表格
|
||||
Dates.viewtb = (function(){
|
||||
var tr, view = [], weeks = [ '日', '一', '二', '三', '四', '五', '六'];
|
||||
var log = {}, table = doc[creat]('table'), thead = doc[creat]('thead');
|
||||
thead.appendChild(doc[creat]('tr'));
|
||||
log.creath = function(i){
|
||||
var th = doc[creat]('th');
|
||||
th.innerHTML = weeks[i];
|
||||
thead[tags]('tr')[0].appendChild(th);
|
||||
th = null;
|
||||
};
|
||||
|
||||
Dates.each(new Array(6), function(i){
|
||||
view.push([]);
|
||||
tr = table.insertRow(0);
|
||||
Dates.each(new Array(7), function(j){
|
||||
view[i][j] = 0;
|
||||
i === 0 && log.creath(j);
|
||||
tr.insertCell(j);
|
||||
});
|
||||
});
|
||||
|
||||
table.insertBefore(thead, table.children[0]);
|
||||
table.id = table.className = 'laydate_table';
|
||||
tr = view = null;
|
||||
return table.outerHTML.toLowerCase();
|
||||
}());
|
||||
|
||||
//渲染控件骨架
|
||||
Dates.view = function(elem, options){
|
||||
var S = Dates.query, div, log = {};
|
||||
options = options || elem;
|
||||
|
||||
Dates.elem = elem;
|
||||
Dates.options = options;
|
||||
Dates.options.format || (Dates.options.format = config.format);
|
||||
Dates.options.start = Dates.options.start || '';
|
||||
Dates.mm = log.mm = [Dates.options.min || config.min, Dates.options.max || config.max];
|
||||
Dates.mins = log.mm[0].match(/\d+/g);
|
||||
Dates.maxs = log.mm[1].match(/\d+/g);
|
||||
|
||||
if(!Dates.box){
|
||||
div = doc[creat]('div');
|
||||
div.id = as[0];
|
||||
div.className = as[0];
|
||||
div.style.cssText = 'position: absolute;';
|
||||
div.setAttribute('name', 'laydate-v'+ laydate.v);
|
||||
|
||||
div.innerHTML = log.html = '<div class="laydate_top">'
|
||||
+'<div class="laydate_ym laydate_y" id="laydate_YY">'
|
||||
+'<a class="laydate_choose laydate_chprev laydate_tab"><cite></cite></a>'
|
||||
+'<input id="laydate_y" readonly><label></label>'
|
||||
+'<a class="laydate_choose laydate_chnext laydate_tab"><cite></cite></a>'
|
||||
+'<div class="laydate_yms">'
|
||||
+'<a class="laydate_tab laydate_chtop"><cite></cite></a>'
|
||||
+'<ul id="laydate_ys"></ul>'
|
||||
+'<a class="laydate_tab laydate_chdown"><cite></cite></a>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="laydate_ym laydate_m" id="laydate_MM">'
|
||||
+'<a class="laydate_choose laydate_chprev laydate_tab"><cite></cite></a>'
|
||||
+'<input id="laydate_m" readonly><label></label>'
|
||||
+'<a class="laydate_choose laydate_chnext laydate_tab"><cite></cite></a>'
|
||||
+'<div class="laydate_yms" id="laydate_ms">'+ function(){
|
||||
var str = '';
|
||||
Dates.each(new Array(12), function(i){
|
||||
str += '<span m="'+ i +'">'+ Dates.digit(i+1) +'月</span>';
|
||||
});
|
||||
return str;
|
||||
}() +'</div>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+ Dates.viewtb
|
||||
|
||||
+'<div class="laydate_bottom">'
|
||||
+'<ul id="laydate_hms">'
|
||||
+'<li class="laydate_sj">时间</li>'
|
||||
+'<li><input readonly>:</li>'
|
||||
+'<li><input readonly>:</li>'
|
||||
+'<li><input readonly></li>'
|
||||
+'</ul>'
|
||||
+'<div class="laydate_time" id="laydate_time"></div>'
|
||||
+'<div class="laydate_btn">'
|
||||
+'<a id="laydate_clear">清空</a>'
|
||||
+'<a id="laydate_today">今天</a>'
|
||||
+'<a id="laydate_ok">确认</a>'
|
||||
+'</div>'
|
||||
+(config.isv ? '<a href="http://sentsin.com/layui/laydate/" class="laydate_v" target="_blank">laydate-v'+ laydate.v +'</a>' : '')
|
||||
+'</div>';
|
||||
doc.body.appendChild(div);
|
||||
Dates.box = S('#'+as[0]);
|
||||
Dates.events();
|
||||
div = null;
|
||||
} else {
|
||||
Dates.shde(Dates.box);
|
||||
}
|
||||
Dates.follow(Dates.box);
|
||||
options.zIndex ? Dates.box.style.zIndex = options.zIndex : Dates.removeCssAttr(Dates.box, 'z-index');
|
||||
Dates.stopMosup('click', Dates.box);
|
||||
|
||||
Dates.initDate(options.format);
|
||||
Dates.iswrite();
|
||||
Dates.check();
|
||||
};
|
||||
|
||||
//隐藏内部弹出元素
|
||||
Dates.reshow = function(){
|
||||
Dates.each(Dates.query('#'+ as[0] +' .laydate_show'), function(i, elem){
|
||||
Dates.removeClass(elem, 'laydate_show');
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
//关闭控件
|
||||
Dates.close = function(){
|
||||
Dates.reshow();
|
||||
Dates.shde(Dates.query('#'+ as[0]), 1);
|
||||
Dates.elem = null;
|
||||
};
|
||||
|
||||
//转换日期格式
|
||||
Dates.parse = function(ymd, hms, format){
|
||||
ymd = ymd.concat(hms); // [year, month, day, hour, minute, second]
|
||||
format = format || (Dates.options ? Dates.options.format : config.format);
|
||||
return format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index){
|
||||
var pos = -1;
|
||||
if (str === 'YYYY') {
|
||||
pos = 0;
|
||||
} else if (str === 'MM') {
|
||||
pos = 1;
|
||||
} else if (str === 'DD') {
|
||||
pos = 2;
|
||||
} else if (str === 'hh') {
|
||||
pos = 3;
|
||||
} else if (str === 'mm') {
|
||||
pos = 4;
|
||||
} else if (str === 'ss') {
|
||||
pos = 5;
|
||||
}
|
||||
return Dates.digit(ymd[pos]);
|
||||
});
|
||||
};
|
||||
|
||||
//返回最终日期
|
||||
Dates.creation = function(ymd, hide){
|
||||
var S = Dates.query, hms = Dates.hmsin;
|
||||
var getDates = Dates.parse(ymd, [hms[0].value, hms[1].value, hms[2].value]);
|
||||
Dates.elem[as.elemv] = getDates;
|
||||
if(!hide){
|
||||
Dates.close();
|
||||
typeof Dates.options.choose === 'function' && Dates.options.choose(getDates);
|
||||
}
|
||||
};
|
||||
|
||||
//事件
|
||||
Dates.events = function(){
|
||||
var S = Dates.query, log = {
|
||||
box: '#'+as[0]
|
||||
};
|
||||
|
||||
Dates.addClass(doc.body, 'laydate_body');
|
||||
|
||||
as.tds = S('#laydate_table td');
|
||||
as.mms = S('#laydate_ms span');
|
||||
as.year = S('#laydate_y');
|
||||
as.month = S('#laydate_m');
|
||||
|
||||
//显示更多年月
|
||||
Dates.each(S(log.box + ' .laydate_ym'), function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev).reshow();
|
||||
Dates.addClass(this[tags]('div')[0], 'laydate_show');
|
||||
if(!i){
|
||||
log.YY = parseInt(as.year.value);
|
||||
Dates.viewYears(log.YY);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Dates.on(S(log.box), 'click', function(){
|
||||
Dates.reshow();
|
||||
});
|
||||
|
||||
//切换年
|
||||
log.tabYear = function(type){
|
||||
if(type === 0){
|
||||
Dates.ymd[0]--;
|
||||
} else if(type === 1) {
|
||||
Dates.ymd[0]++;
|
||||
} else if(type === 2) {
|
||||
log.YY -= 14;
|
||||
} else {
|
||||
log.YY += 14;
|
||||
}
|
||||
if(type < 2){
|
||||
Dates.viewDate(Dates.ymd[0], Dates.ymd[1], Dates.ymd[2]);
|
||||
Dates.reshow();
|
||||
} else {
|
||||
Dates.viewYears(log.YY);
|
||||
}
|
||||
};
|
||||
Dates.each(S('#laydate_YY .laydate_tab'), function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev);
|
||||
log.tabYear(i);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//切换月
|
||||
log.tabMonth = function(type){
|
||||
if(type){
|
||||
Dates.ymd[1]++;
|
||||
if(Dates.ymd[1] === 12){
|
||||
Dates.ymd[0]++;
|
||||
Dates.ymd[1] = 0;
|
||||
}
|
||||
} else {
|
||||
Dates.ymd[1]--;
|
||||
if(Dates.ymd[1] === -1){
|
||||
Dates.ymd[0]--;
|
||||
Dates.ymd[1] = 11;
|
||||
}
|
||||
}
|
||||
Dates.viewDate(Dates.ymd[0], Dates.ymd[1], Dates.ymd[2]);
|
||||
};
|
||||
Dates.each(S('#laydate_MM .laydate_tab'), function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev).reshow();
|
||||
log.tabMonth(i);
|
||||
});
|
||||
});
|
||||
|
||||
//选择月
|
||||
Dates.each(S('#laydate_ms span'), function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev).reshow();
|
||||
if(!Dates.hasClass(this, as[1])){
|
||||
Dates.viewDate(Dates.ymd[0], this.getAttribute('m')|0, Dates.ymd[2]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//选择日
|
||||
Dates.each(S('#laydate_table td'), function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
if(!Dates.hasClass(this, as[1])){
|
||||
Dates.stopmp(ev);
|
||||
if(Dates.options.istime){
|
||||
+ Dates.viewDate([this.getAttribute('y')|0, (this.getAttribute('m')|0)-1, this.getAttribute('d')|0]);
|
||||
+ }else{
|
||||
+ Dates.creation([this.getAttribute('y')|0, this.getAttribute('m')|0, this.getAttribute('d')|0]);
|
||||
+ }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//清空
|
||||
as.oclear = S('#laydate_clear');
|
||||
Dates.on(as.oclear, 'click', function(){
|
||||
Dates.elem[as.elemv] = '';
|
||||
Dates.close();
|
||||
});
|
||||
|
||||
//今天
|
||||
as.otoday = S('#laydate_today');
|
||||
Dates.on(as.otoday, 'click', function(){
|
||||
var now = new Date();
|
||||
// 2016-09-23 18:20:54 修复选中今天choose方法得不到数据
|
||||
// Dates.creation([now.getFullYear(), now.getMonth() + 1, now.getDate()]);
|
||||
|
||||
// 2016-09-26 10:49:25 修复选中今天 如果YYYY-MM-DD hh:mm:ss格式,获取当前的时分秒
|
||||
var hms = Dates.hmsin;
|
||||
var date = new Date();
|
||||
// 获取当前时间小时
|
||||
hms[0].value = date.getHours();
|
||||
// 获取当前时间分钟
|
||||
hms[1].value = date.getMinutes();
|
||||
// 获取当前时间秒
|
||||
hms[2].value = date.getSeconds();
|
||||
Dates.creation([Dates.ymd[0], Dates.ymd[1]+1, Dates.ymd[2]]);
|
||||
});
|
||||
|
||||
//确认
|
||||
as.ok = S('#laydate_ok');
|
||||
Dates.on(as.ok, 'click', function(){
|
||||
if(Dates.valid){
|
||||
Dates.creation([Dates.ymd[0], Dates.ymd[1]+1, Dates.ymd[2]]);
|
||||
}
|
||||
});
|
||||
|
||||
//选择时分秒
|
||||
log.times = S('#laydate_time');
|
||||
Dates.hmsin = log.hmsin = S('#laydate_hms input');
|
||||
log.hmss = ['小时', '分钟', '秒数'];
|
||||
log.hmsarr = [];
|
||||
|
||||
//生成时分秒或警告信息
|
||||
Dates.msg = function(i, title){
|
||||
var str = '<div class="laydte_hsmtex">'+ (title || '提示') +'<span>×</span></div>';
|
||||
if(typeof i === 'string'){
|
||||
str += '<p>'+ i +'</p>';
|
||||
Dates.shde(S('#'+as[0]));
|
||||
Dates.removeClass(log.times, 'laydate_time1').addClass(log.times, 'laydate_msg');
|
||||
} else {
|
||||
if(!log.hmsarr[i]){
|
||||
str += '<div id="laydate_hmsno" class="laydate_hmsno">';
|
||||
Dates.each(new Array(i === 0 ? 24 : 60), function(i){
|
||||
str += '<span>'+ i +'</span>';
|
||||
});
|
||||
str += '</div>'
|
||||
log.hmsarr[i] = str;
|
||||
} else {
|
||||
str = log.hmsarr[i];
|
||||
}
|
||||
Dates.removeClass(log.times, 'laydate_msg');
|
||||
Dates[i=== 0 ? 'removeClass' : 'addClass'](log.times, 'laydate_time1');
|
||||
}
|
||||
Dates.addClass(log.times, 'laydate_show');
|
||||
log.times.innerHTML = str;
|
||||
};
|
||||
|
||||
log.hmson = function(input, index){
|
||||
var span = S('#laydate_hmsno span'), set = Dates.valid ? null : 1;
|
||||
Dates.each(span, function(i, elem){
|
||||
if(set){
|
||||
Dates.addClass(elem, as[1]);
|
||||
} else if(Dates.timeVoid(i, index)){
|
||||
Dates.addClass(elem, as[1]);
|
||||
} else {
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
if(!Dates.hasClass(this, as[1])){
|
||||
input.value = Dates.digit(this.innerHTML|0);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Dates.addClass(span[input.value|0], 'laydate_click');
|
||||
};
|
||||
|
||||
//展开选择
|
||||
Dates.each(log.hmsin, function(i, elem){
|
||||
Dates.on(elem, 'click', function(ev){
|
||||
Dates.stopmp(ev).reshow();
|
||||
Dates.msg(i, log.hmss[i]);
|
||||
log.hmson(this, i);
|
||||
});
|
||||
});
|
||||
|
||||
Dates.on(doc, 'mouseup', function(){
|
||||
var box = S('#'+as[0]);
|
||||
if(box && box.style.display !== 'none'){
|
||||
Dates.check() || Dates.close();
|
||||
}
|
||||
}).on(doc, 'keydown', function(event){
|
||||
event = event || win.event;
|
||||
var codes = event.keyCode;
|
||||
|
||||
//如果在日期显示的时候按回车
|
||||
if(codes === 13 && Dates.elem){
|
||||
Dates.creation([Dates.ymd[0], Dates.ymd[1]+1, Dates.ymd[2]]);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Dates.init = (function(){
|
||||
Dates.use('need');
|
||||
Dates.use(as[4] + config.skin, as[3]);
|
||||
Dates.skinLink = Dates.query('#'+as[3]);
|
||||
}());
|
||||
|
||||
//重置定位
|
||||
laydate.reset = function(){
|
||||
(Dates.box && Dates.elem) && Dates.follow(Dates.box);
|
||||
};
|
||||
|
||||
//返回指定日期
|
||||
laydate.now = function(timestamp, format){
|
||||
var De = new Date((timestamp|0) ? function(tamp){
|
||||
return tamp < 86400000 ? (+new Date + tamp*86400000) : tamp;
|
||||
}(parseInt(timestamp)) : +new Date);
|
||||
return Dates.parse(
|
||||
[De.getFullYear(), De.getMonth()+1, De.getDate()],
|
||||
[De.getHours(), De.getMinutes(), De.getSeconds()],
|
||||
format
|
||||
);
|
||||
};
|
||||
|
||||
//皮肤选择
|
||||
laydate.skin = chgSkin;
|
||||
|
||||
//内部函数
|
||||
function chgSkin(lib) {
|
||||
Dates.skinLink.href = Dates.getPath + as[4] + lib + as[5];
|
||||
};
|
||||
|
||||
}(window);
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
|
||||
@Name: laydate 核心样式
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
html{_background-image:url(about:blank); _background-attachment:fixed;}
|
||||
.laydate_body .laydate_box, .laydate_body .laydate_box *{margin:0; padding:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box;}
|
||||
.laydate-icon,
|
||||
.laydate-icon-default,
|
||||
.laydate-icon-danlan,
|
||||
.laydate-icon-dahong,
|
||||
.laydate-icon-molv{height:22px; line-height:22px; padding-right:20px; border:1px solid #C6C6C6; background-repeat:no-repeat; background-position:right center; background-color:#fff; outline:0;}
|
||||
.laydate-icon-default{ background-image:url(../skins/default/icon.png)}
|
||||
.laydate-icon-danlan{border:1px solid #B1D2EC; background-image:url(../skins/danlan/icon.png)}
|
||||
.laydate-icon-dahong{background-image:url(../skins/dahong/icon.png)}
|
||||
.laydate-icon-molv{background-image:url(../skins/molv/icon.png)}
|
||||
.laydate_body .laydate_box{width:240px; font:12px '\5B8B\4F53'; z-index:99999999; *margin:-2px 0 0 -2px; *overflow:hidden; _margin:0; _position:absolute!important; background-color:#fff;}
|
||||
.laydate_body .laydate_box li{list-style:none;}
|
||||
.laydate_body .laydate_box .laydate_void{cursor:text!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{text-decoration:none; blr:expression(this.onFocus=this.blur()); cursor:pointer;}
|
||||
.laydate_body .laydate_box a:hover{text-decoration:none;}
|
||||
.laydate_body .laydate_box cite, .laydate_body .laydate_box label{position:absolute; width:0; height:0; border-width:5px; border-style:dashed; border-color:transparent; overflow:hidden; cursor:pointer;}
|
||||
.laydate_body .laydate_box .laydate_yms, .laydate_body .laydate_box .laydate_time{display:none;}
|
||||
.laydate_body .laydate_box .laydate_show{display:block;}
|
||||
.laydate_body .laydate_box input{outline:0; font-size:14px; background-color:#fff;}
|
||||
.laydate_body .laydate_top{position:relative; height:26px; padding:5px; *width:100%; z-index:99;}
|
||||
.laydate_body .laydate_ym{position:relative; float:left; height:24px; cursor:pointer;}
|
||||
.laydate_body .laydate_ym input{float:left; height:24px; line-height:24px; text-align:center; border:none; cursor:pointer;}
|
||||
.laydate_body .laydate_ym .laydate_yms{position:absolute; left: -1px; top: 24px; height:181px;}
|
||||
.laydate_body .laydate_y{width:121px; margin-right:6px;}
|
||||
.laydate_body .laydate_y input{width:64px; margin-right:15px;}
|
||||
.laydate_body .laydate_y .laydate_yms{width:121px; text-align:center;}
|
||||
.laydate_body .laydate_y .laydate_yms a{position:relative; display:block; height:20px;}
|
||||
.laydate_body .laydate_y .laydate_yms ul{height:139px; padding:0; *overflow:hidden;}
|
||||
.laydate_body .laydate_y .laydate_yms ul li{float:left; width:60px; height:20px; line-height: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.laydate_body .laydate_m{width:99px;}
|
||||
.laydate_body .laydate_m .laydate_yms{width:99px; padding:0;}
|
||||
.laydate_body .laydate_m input{width:42px; margin-right:15px;}
|
||||
.laydate_body .laydate_m .laydate_yms span{display:block; float:left; width:42px; margin: 5px 0 0 5px; line-height:24px; text-align:center; _display:inline;}
|
||||
.laydate_body .laydate_choose{display:block; float:left; position:relative; width:20px; height:24px;}
|
||||
.laydate_body .laydate_choose cite, .laydate_body .laydate_tab cite{left:50%; top:50%;}
|
||||
.laydate_body .laydate_chtop cite{margin:-7px 0 0 -5px; border-bottom-style:solid;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{top:50%; margin:-2px 0 0 -5px; border-top-style:solid;}
|
||||
.laydate_body .laydate_chprev cite{margin:-5px 0 0 -7px;}
|
||||
.laydate_body .laydate_chnext cite{margin:-5px 0 0 -2px;}
|
||||
.laydate_body .laydate_ym label{right:28px;}
|
||||
.laydate_body .laydate_table{ width:230px; margin:0 5px; border-collapse:collapse; border-spacing:0px; }
|
||||
.laydate_body .laydate_table td{width:31px; height:19px; line-height:19px; text-align: center; cursor:pointer; font-size: 12px;}
|
||||
.laydate_body .laydate_table thead{height:22px; line-height:22px;}
|
||||
.laydate_body .laydate_table thead th{font-weight:400; font-size:12px; text-align:center;}
|
||||
.laydate_body .laydate_bottom{position:relative; height:22px; line-height:20px; padding:5px; font-size:12px;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{position: relative; z-index: 1; float:left; }
|
||||
.laydate_body .laydate_time{ position:absolute; left:5px; bottom: 26px; width:129px; height:125px; *overflow:hidden;}
|
||||
.laydate_body .laydate_time .laydate_hmsno{ padding:5px 0 0 5px;}
|
||||
.laydate_body .laydate_time .laydate_hmsno span{display:block; float:left; width:24px; height:19px; line-height:19px; text-align:center; cursor:pointer; *margin-bottom:-5px;}
|
||||
.laydate_body .laydate_time1{width:228px; height:154px;}
|
||||
.laydate_body .laydate_time1 .laydate_hmsno{padding: 6px 0 0 8px;}
|
||||
.laydate_body .laydate_time1 .laydate_hmsno span{width:21px; height:20px; line-height:20px;}
|
||||
.laydate_body .laydate_msg{left:49px; bottom:67px; width:141px; height:auto; overflow: hidden;}
|
||||
.laydate_body .laydate_msg p{padding:5px 10px;}
|
||||
.laydate_body .laydate_bottom li{float:left; height:20px; line-height:20px; border-right:none; font-weight:900;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{width:33px; text-align:center; font-weight:400;}
|
||||
.laydate_body .laydate_bottom input{float:left; width:21px; height:20px; line-height:20px; border:none; text-align:center; cursor:pointer; font-size:12px; font-weight:400;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{height:20px; line-height:20px; text-align:center;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex span{position:absolute; width:20px; top:0; right:0px; cursor:pointer;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex span:hover{font-size:14px;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{position:absolute; right:5px; top:5px;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{float:left; height:20px; padding:0 6px; _padding:0 5px;}
|
||||
.laydate_body .laydate_bottom .laydate_v{position:absolute; left:10px; top:6px; font-family:Courier; z-index:0;}
|
||||
|
40
package.json
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"name": "layui-laydate",
|
||||
"realname": "layDate",
|
||||
"version": "5.3.1",
|
||||
"description": "日期与时间组件",
|
||||
"main": "src/laydate.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"run": "gulp"
|
||||
},
|
||||
"repository": {
|
||||
"type": "https",
|
||||
"url": "git+https://github.com/sentsin/laydate.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-minify-css": "^1.2.4",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-header": "^1.8.8",
|
||||
"del": "^2.2.2"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sentsin/laydate/issues"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {},
|
||||
"keywords": [
|
||||
"laydate",
|
||||
"date",
|
||||
"time",
|
||||
"datetime",
|
||||
"datepicker",
|
||||
"calendar"
|
||||
],
|
||||
"homepage": "https://github.com/sentsin/laydate#readme",
|
||||
"author": ""
|
||||
}
|
After Width: | Height: | Size: 307 B |
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:大红
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time{border:1px solid #ccc;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#333;}
|
||||
.laydate_body .laydate_box input{background:none!important; color:#fff;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#ccc!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#333;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#F32043!important; color:#fff!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #D91600; background-color:#D91600}
|
||||
.laydate_body .laydate_ym{border:1px solid #D91600; background-color:#D91600;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #D91600; background-color:#D91600; color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #D91600;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #D91600; border-bottom:none;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #D91600;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #D91600;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#F54766;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#fff;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;}
|
||||
.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;}
|
||||
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#333;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#999;}
|
||||
.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;}
|
||||
.laydate_body .laydate_table thead th{}
|
||||
.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff; color:#333;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#999}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#333;}
|
||||
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_time .laydate_hmsno span:hover,
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_table td:hover{background-color:#F54766; color:#fff;}
|
||||
|
||||
|
After Width: | Height: | Size: 328 B |
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:淡蓝
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #B1D2EC; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_table,
|
||||
.laydate_body .laydate_table td,
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time,
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border:1px solid #B1D2EC;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms a,
|
||||
.laydate_body .laydate_choose,
|
||||
.laydate_body .laydate_table thead{background-color:#DEECF8;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#1F547E;}
|
||||
.laydate_body .laydate_box input{color:#1F547E;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#BDD8EE!important;}
|
||||
.laydate_body .laydate_box .laydate_void:hover{background-color:#fff!important}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#1F547E;}
|
||||
.laydate_body .laydate_click{background-color:#DEECF8!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_ym .laydate_yms{background-color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #B1D2EC; border-bottom:none;}
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_m .laydate_yms span:hover{color:#000;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#3081C2;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#3081C2;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#3081C2;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#3081C2;}
|
||||
.laydate_body .laydate_table td{background-color:#fff; color:#1F547E;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#60A2D7;}
|
||||
.laydate_body .laydate_table thead{color:#163A58;}
|
||||
.laydate_body .laydate_bottom{border-bottom:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{border-right:1px solid #B1D2EC; background-color:#ECF4FB;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #B1D2EC;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#75AEDD}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{ border-right:none; background-color:#ECF4FB;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{ background-color:#fff;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover,
|
||||
.laydate_body .laydate_table td:hover,
|
||||
.laydate_body .laydate_bottom .laydate_time span:hover,
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{background-color:#ECF4FB}
|
||||
|
After Width: | Height: | Size: 314 B |
|
@ -0,0 +1,68 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:默认
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #C6C6C6; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_table,
|
||||
.laydate_body .laydate_table td,
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time,
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border:1px solid #ccc;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms a,
|
||||
.laydate_body .laydate_choose,
|
||||
.laydate_body .laydate_table thead,
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{background-color:#F6F6F6;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#333;}
|
||||
.laydate_body .laydate_box input{color:#333;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#ccc!important; /*text-decoration:line-through;*/}
|
||||
.laydate_body .laydate_box .laydate_void:hover{background-color:#fff!important}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#333;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#eee!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #C6C6C6; background-color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #C6C6C6; border-bottom:none;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#fff;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#666;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#666;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#666;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#666;}
|
||||
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#999;}
|
||||
.laydate_body .laydate_table thead{height:21px!important; line-height:21px!important;}
|
||||
.laydate_body .laydate_table thead th{border-bottom:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{border-right:1px solid #C6C6C6; background-color:#F6F6F6;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#999}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border-right:none; background-color:#F6F6F6;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{color:#000; background-color:#fff;}
|
||||
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_table td:hover,
|
||||
.laydate_body .laydate_time .laydate_hmsno span:hover{background-color:#F3F3F3}
|
||||
|
||||
|
After Width: | Height: | Size: 309 B |
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:墨绿
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time{border:1px solid #ccc;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_box input{background:none!important; color:#fff;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#00E8D7!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#00625A;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#009F95!important; color:#fff!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #009F95; background-color:#009F95}
|
||||
.laydate_body .laydate_ym{border:1px solid #009F95; background-color:#009F95;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #009F95; background-color:#009F95; color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #009F95;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #009F95; border-bottom:none;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #009F95;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #009F95;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#00C1B3;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#fff;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;}
|
||||
.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;}
|
||||
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#999;}
|
||||
.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;}
|
||||
.laydate_body .laydate_table thead th{}
|
||||
.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#999}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#00625A;}
|
||||
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_time .laydate_hmsno span:hover,
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_table td:hover{background-color:#00C1B3; color:#fff;}
|
||||
|
||||
|
After Width: | Height: | Size: 328 B |
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:浅黄
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #E7D7CB; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_table,
|
||||
.laydate_body .laydate_table td,
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time,
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border:1px solid #DEC8B8;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms a,
|
||||
.laydate_body .laydate_ym,
|
||||
.laydate_body .laydate_choose,
|
||||
.laydate_body .laydate_table thead{background-color:#fff;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color: #F7F4ED!important; color:#8B743F;}
|
||||
.laydate_body .laydate_box input{color:#8B743F;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#CBB98D!important;}
|
||||
.laydate_body .laydate_box .laydate_void:hover{background-color:#fff!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#8B743F;}
|
||||
.laydate_body .laydate_box a:hover{color:#8B743F;}
|
||||
.laydate_body .laydate_click{background-color:#DEC8B8!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_ym .laydate_yms{background-color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #DEC8B8; border-bottom:none;}
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_m .laydate_yms span:hover{color:#8B743F;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#8B743F;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#8B743F;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#8B743F;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#8B743F;}
|
||||
.laydate_body .laydate_table td{background-color:#F4F0E6; color:#8B743F;}
|
||||
.laydate_body .laydate_table .laydate_nothis{background-color:#fff; color:#C0AA76;}
|
||||
.laydate_body .laydate_table thead{color:#163A58;}
|
||||
.laydate_body .laydate_bottom{border-bottom:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{border-right:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #DEC8B8;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{ border-right:none; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{color:#163A58;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover,
|
||||
.laydate_body .laydate_table td:hover,
|
||||
.laydate_body .laydate_bottom .laydate_sj,
|
||||
.laydate_body .laydate_bottom .laydate_time span:hover,
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex,
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F7F4ED}
|
||||
|
After Width: | Height: | Size: 314 B |
|
@ -0,0 +1,68 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:雅灰
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #C6C6C6; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_table,
|
||||
.laydate_body .laydate_table td,
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time,
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border:1px solid #C6C6C6;}
|
||||
|
||||
.laydate_body .laydate_y .laydate_yms a,
|
||||
.laydate_body .laydate_choose,
|
||||
.laydate_body .laydate_table thead,
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{background-color:#F0F0F0;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#333;}
|
||||
.laydate_body .laydate_box input{color:#333;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#ccc!important; /*text-decoration:line-through;*/}
|
||||
.laydate_body .laydate_box .laydate_void:hover{background-color:#fff!important}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#333;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#E9E9E9!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #C6C6C6; background-color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #C6C6C6; border-bottom:none;}
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover{background-color:#F1F1F1; color:#000;}
|
||||
.laydate_body .laydate_m .laydate_yms span:hover{background-color:#F1F1F1; color:#000;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#F6F6F6;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#666;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#666;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#666;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#666;}
|
||||
.laydate_body .laydate_table td{border:1px solid #C6C6C6; color:#333;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#999;}
|
||||
.laydate_body .laydate_table thead{ background-color:#E3E3E3; color:#000;}
|
||||
.laydate_body .laydate_table thead th{}
|
||||
.laydate_body .laydate_bottom{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{border-right:1px solid #C6C6C6; background-color:#F3F3F3;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #C6C6C6;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#999}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border-right:none; background-color:#F0F0F0;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{color:#000; background-color:#fff;}
|
||||
|
||||
.laydate_body .laydate_table td:hover,
|
||||
.laydate_body .laydate_bottom .laydate_time span:hover{background-color:#F2F2F2}
|
||||
|
||||
|
After Width: | Height: | Size: 324 B |
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
|
||||
@Name: laydate皮肤:雅兰
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #34AADC; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_table,
|
||||
.laydate_body .laydate_table td,
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time,
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border:1px solid #34AADC;}
|
||||
|
||||
.laydate_body .laydate_box{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{background-color:#34AADC!important; color:#fff;}
|
||||
.laydate_body .laydate_box input{background:none!important; color:#fff;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#fff!important; background:none!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#333;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#67BFE4!important; color:#fff!important;}
|
||||
.laydate_body .laydate_top{}
|
||||
.laydate_body .laydate_ym{background-color:#50B5E0; border:1px solid #50B5E0;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #2293C4; background-color:#2293C4;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #50B5E0; background-color:#50B5E0;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #50B5E0; border-bottom:none;}
|
||||
.laydate_body .laydate_choose{}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #50B5E0;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#61BBE2;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#C7E8F5;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#C7E8F5;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#C7E8F5;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#C7E8F5;}
|
||||
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#50B5E0; color:#fff;}
|
||||
.laydate_body .laydate_table .laydate_nothis{background:none;}
|
||||
.laydate_body .laydate_table thead{height:21px!important; line-height:21px!important;}
|
||||
.laydate_body .laydate_table thead th{}
|
||||
.laydate_body .laydate_bottom{border-bottom:1px solid #34AADC; color:#fff;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#50B5E0;}
|
||||
.laydate_body .laydate_time{background-color:#2293C4;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{border-right:1px solid #50B5E0; background-color:#50B5E0; color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #67BFE4; background-color:#2293C4;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #34AADC;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#ccc}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border-right:none; background-color:#50B5E0; color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#6BC0E4;}
|
||||
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_table td:hover,
|
||||
.laydate_body .laydate_time .laydate_hmsno span:hover{background-color:#87CBE9; color:#fff;}
|
||||
|
||||
|
2813
src/laydate.js
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2013-9-30: Created.
|
||||
-->
|
||||
<svg>
|
||||
<metadata>
|
||||
Created by iconfont
|
||||
</metadata>
|
||||
<defs>
|
||||
|
||||
<font id="laydate-icon" horiz-adv-x="1024" >
|
||||
<font-face
|
||||
font-family="laydate-icon"
|
||||
font-weight="500"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
|
||||
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
|
||||
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
|
||||
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
|
||||
|
||||
|
||||
|
||||
<glyph glyph-name="youyou" unicode="" d="M283.648 721.918976 340.873216 780.926976 740.352 383.997952 340.876288-12.925952 283.648 46.077952 619.52 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="zuozuo" unicode="" d="M740.352 721.918976 683.126784 780.926976 283.648 383.997952 683.123712-12.925952 740.352 46.077952 404.48 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye" unicode="" d="M62.573 384.103l423.401 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.751-18.976-68.727 0l-39.753 39.753 0.269 0.246-385.655 385.661zM451.365 384.103l423.407 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.757-18.977-68.727 0l-39.762 39.754 0.273 0.249-385.662 385.661zM451.365 384.103z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye1" unicode="" d="M948.066926 382.958838l-411.990051-412.24426c-18.47333-18.47333-48.417689-18.47333-66.875207 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L814.691135 383.088983 467.512212 730.269123c-18.466032 18.458735-18.466032 48.405526 0 66.873991 18.468465 18.464816 48.410391 18.464816 66.872774 0l38.682336-38.682336-0.261507-0.239614 375.259894-375.265975v0.003649m-378.312834 0L157.756743-29.285422c-18.47333-18.47333-48.415256-18.47333-66.872775 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L436.369787 383.088983 89.19208 730.269123c-18.4636 18.458735-18.4636 48.405526 0 66.873991 18.470898 18.464816 48.415256 18.464816 66.872774 0l38.692067-38.682336-0.266372-0.239614 375.267191-375.265975-0.004865 0.003649m0 0z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
</defs></svg>
|
Before Width: | Height: | Size: 3.0 KiB |
|
@ -1,169 +0,0 @@
|
|||
/** 图标字体 **/
|
||||
@font-face {font-family: 'laydate-icon';
|
||||
src: url('./font/iconfont.eot');
|
||||
src: url('./font/iconfont.eot#iefix') format('embedded-opentype'),
|
||||
url('./font/iconfont.svg#iconfont') format('svg'),
|
||||
url('./font/iconfont.woff') format('woff'),
|
||||
url('./font/iconfont.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.laydate-icon{
|
||||
font-family:"laydate-icon" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@Name: laydata
|
||||
|
||||
**/
|
||||
|
||||
|
||||
html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||
|
||||
/* 初始化 */
|
||||
.layui-laydate *{margin: 0; padding: 0;}
|
||||
|
||||
/* 主体结构 */
|
||||
.layui-laydate, .layui-laydate *{box-sizing: border-box;}
|
||||
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.2s; animation-duration: 0.2s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
.layui-laydate-main{width: 272px;}
|
||||
.layui-laydate-header *,
|
||||
.layui-laydate-content td,
|
||||
.layui-laydate-list li{transition-duration: .3s; -webkit-transition-duration: .3s;}
|
||||
|
||||
/* 微微往下滑入 */
|
||||
@keyframes laydate-downbit {
|
||||
0% {opacity: 0.3; transform: translate3d(0, -5px, 0);}
|
||||
100% {opacity: 1; transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
|
||||
.layui-laydate{animation-name: laydate-downbit;}
|
||||
.layui-laydate-static{ position: relative; z-index: 0; display: inline-block; margin: 0; -webkit-animation: none; animation: none;}
|
||||
|
||||
/* 展开年月列表时 */
|
||||
.laydate-ym-show .laydate-prev-m,
|
||||
.laydate-ym-show .laydate-next-m{display: none !important;}
|
||||
.laydate-ym-show .laydate-prev-y,
|
||||
.laydate-ym-show .laydate-next-y{display: inline-block !important;}
|
||||
.laydate-ym-show .laydate-set-ym span[lay-type="month"]{display: none !important;}
|
||||
|
||||
/* 展开时间列表时 */
|
||||
.laydate-time-show .layui-laydate-header .layui-icon,
|
||||
.laydate-time-show .laydate-set-ym span[lay-type="year"],
|
||||
.laydate-time-show .laydate-set-ym span[lay-type="month"]{display: none !important;}
|
||||
|
||||
/* 头部结构 */
|
||||
.layui-laydate-header{position: relative; line-height:30px; padding: 10px 70px 5px;}
|
||||
.layui-laydate-header *{display: inline-block; vertical-align: bottom;}
|
||||
.layui-laydate-header i{position: absolute; top: 10px; padding: 0 5px; color: #999; font-size: 18px; cursor: pointer;}
|
||||
.layui-laydate-header i.laydate-prev-y{left: 15px;}
|
||||
.layui-laydate-header i.laydate-prev-m{left: 45px;}
|
||||
.layui-laydate-header i.laydate-next-y{right: 15px;}
|
||||
.layui-laydate-header i.laydate-next-m{right: 45px;}
|
||||
.laydate-set-ym{width: 100%; text-align: center; box-sizing: border-box; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.laydate-set-ym span{padding: 0 10px; cursor: pointer;}
|
||||
.laydate-time-text{cursor: default !important;}
|
||||
|
||||
/* 主体结构 */
|
||||
.layui-laydate-content{position: relative; padding: 10px; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
|
||||
.layui-laydate-content table{border-collapse: collapse; border-spacing: 0;}
|
||||
.layui-laydate-content th,
|
||||
.layui-laydate-content td{width: 36px; height: 30px; padding: 5px; text-align: center;}
|
||||
.layui-laydate-content th{font-weight: 400;}
|
||||
.layui-laydate-content td{position: relative; cursor: pointer;}
|
||||
.laydate-day-mark{position: absolute; left: 0; top: 0; width: 100%; line-height: 30px; font-size: 12px; overflow: hidden;}
|
||||
.laydate-day-mark::after{position: absolute; content:''; right: 2px; top: 2px; width: 5px; height: 5px; border-radius: 50%;}
|
||||
|
||||
/* 底部结构 */
|
||||
.layui-laydate-footer{position: relative; height: 46px; line-height: 26px; padding: 10px;}
|
||||
.layui-laydate-footer span{display: inline-block; vertical-align: top; height: 26px; line-height: 24px; padding: 0 10px; border: 1px solid #C9C9C9; border-radius: 2px; background-color: #fff; font-size: 12px; cursor: pointer; white-space: nowrap; transition: all .3s;}
|
||||
.layui-laydate-footer span:hover{color: #5FB878;}
|
||||
.layui-laydate-footer span.layui-laydate-preview{cursor: default; border-color: transparent !important;}
|
||||
.layui-laydate-footer span.layui-laydate-preview:hover{color: #666;}
|
||||
.layui-laydate-footer span:first-child.layui-laydate-preview{padding-left: 0;}
|
||||
.laydate-footer-btns{position: absolute; right: 10px; top: 10px;}
|
||||
.laydate-footer-btns span{margin: 0 0 0 -1px;}
|
||||
|
||||
/* 年月列表 */
|
||||
.layui-laydate-list{position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 10px; box-sizing: border-box; background-color: #fff;}
|
||||
.layui-laydate-list>li{position: relative; display: inline-block; width: 33.3%; height: 36px; line-height: 36px; margin: 3px 0; vertical-align: middle; text-align: center; cursor: pointer;}
|
||||
.laydate-month-list>li{width: 25%; margin: 17px 0;}
|
||||
.laydate-time-list{}
|
||||
.laydate-time-list>li{height: 100%; margin: 0; line-height: normal; cursor: default;}
|
||||
.laydate-time-list p{position: relative; top: -4px; line-height: 29px;}
|
||||
.laydate-time-list ol{height: 181px; overflow: hidden;}
|
||||
.laydate-time-list>li:hover ol{overflow-y: auto;}
|
||||
.laydate-time-list ol li{width: 130%; padding-left: 33px; height: 30px; line-height: 30px; text-align: left; cursor: pointer;}
|
||||
|
||||
/* 提示 */
|
||||
.layui-laydate-hint{position: absolute; top: 115px; left: 50%; width: 250px; margin-left: -125px; line-height: 20px; padding: 15px; text-align: center; font-size: 12px; color: #FF5722;}
|
||||
|
||||
|
||||
/* 双日历 */
|
||||
.layui-laydate-range{width: 546px;}
|
||||
.layui-laydate-range .layui-laydate-main{display: inline-block; vertical-align: middle;}
|
||||
.layui-laydate-range .laydate-main-list-1 .layui-laydate-header,
|
||||
.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left: 1px solid #e2e2e2;}
|
||||
|
||||
|
||||
/* 默认简约主题 */
|
||||
.layui-laydate, .layui-laydate-hint{border: 1px solid #d2d2d2; box-shadow: 0 2px 4px rgba(0,0,0,.12); background-color: #fff; color: #666;}
|
||||
.layui-laydate-header{border-bottom: 1px solid #e2e2e2;}
|
||||
.layui-laydate-header i:hover,
|
||||
.layui-laydate-header span:hover{color: #5FB878;}
|
||||
.layui-laydate-content{border-top: none 0; border-bottom: none 0;}
|
||||
.layui-laydate-content th{color: #333;}
|
||||
.layui-laydate-content td{color: #666;}
|
||||
.layui-laydate-content td.laydate-selected{background-color: #B5FFF8;}
|
||||
.laydate-selected:hover{background-color: #00F7DE !important;}
|
||||
.layui-laydate-content td:hover,
|
||||
.layui-laydate-list li:hover{background-color: #eee; color: #333;}
|
||||
.laydate-time-list li ol{margin: 0; padding: 0; border: 1px solid #e2e2e2; border-left-width: 0;}
|
||||
.laydate-time-list li:first-child ol{border-left-width: 1px;}
|
||||
.laydate-time-list>li:hover{background: none;}
|
||||
.layui-laydate-content .laydate-day-prev,
|
||||
.layui-laydate-content .laydate-day-next{color: #d2d2d2;}
|
||||
.laydate-selected.laydate-day-prev,
|
||||
.laydate-selected.laydate-day-next{background-color: #f8f8f8 !important;}
|
||||
.layui-laydate-footer{border-top: 1px solid #e2e2e2;}
|
||||
.layui-laydate-hint{color: #FF5722;}
|
||||
.laydate-day-mark::after{background-color: #5FB878;}
|
||||
.layui-laydate-content td.layui-this .laydate-day-mark::after{display: none;}
|
||||
.layui-laydate-footer span[lay-type="date"]{color: #5FB878;}
|
||||
.layui-laydate .layui-this{background-color: #009688 !important; color: #fff !important;}
|
||||
.layui-laydate .laydate-disabled,
|
||||
.layui-laydate .laydate-disabled:hover{background:none !important; color: #d2d2d2 !important; cursor: not-allowed !important; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
|
||||
|
||||
/* 墨绿/自定义背景色主题 */
|
||||
.laydate-theme-molv{border: none;}
|
||||
.laydate-theme-molv.layui-laydate-range{width: 548px}
|
||||
.laydate-theme-molv .layui-laydate-main{width: 274px;}
|
||||
.laydate-theme-molv .layui-laydate-header{border: none; background-color: #009688;}
|
||||
.laydate-theme-molv .layui-laydate-header i,
|
||||
.laydate-theme-molv .layui-laydate-header span{color: #f6f6f6;}
|
||||
.laydate-theme-molv .layui-laydate-header i:hover,
|
||||
.laydate-theme-molv .layui-laydate-header span:hover{color: #fff;}
|
||||
.laydate-theme-molv .layui-laydate-content{border: 1px solid #e2e2e2; border-top: none; border-bottom: none;}
|
||||
.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left: none;}
|
||||
.laydate-theme-molv .layui-laydate-footer{border: 1px solid #e2e2e2;}
|
||||
|
||||
/* 格子主题 */
|
||||
.laydate-theme-grid .layui-laydate-content td,
|
||||
.laydate-theme-grid .layui-laydate-content thead,
|
||||
.laydate-theme-grid .laydate-year-list>li,
|
||||
.laydate-theme-grid .laydate-month-list>li{border: 1px solid #e2e2e2;}
|
||||
.laydate-theme-grid .laydate-selected,
|
||||
.laydate-theme-grid .laydate-selected:hover{background-color: #f2f2f2 !important; color: #009688 !important;}
|
||||
.laydate-theme-grid .laydate-selected.laydate-day-prev,
|
||||
.laydate-theme-grid .laydate-selected.laydate-day-next{color: #d2d2d2 !important;}
|
||||
.laydate-theme-grid .laydate-year-list,
|
||||
.laydate-theme-grid .laydate-month-list{margin: 1px 0 0 1px;}
|
||||
.laydate-theme-grid .laydate-year-list>li,
|
||||
.laydate-theme-grid .laydate-month-list>li{margin: 0 -1px -1px 0;}
|
||||
.laydate-theme-grid .laydate-year-list>li{height: 43px; line-height: 43px;}
|
||||
.laydate-theme-grid .laydate-month-list>li{height: 71px; line-height: 71px;}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Demo1</title>
|
||||
<style type="text/css">
|
||||
.demo1{
|
||||
height:300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="height:500px;"></div>
|
||||
<div class="demo1">
|
||||
方本框:<input type="text" id="J-xl">
|
||||
</div>
|
||||
|
||||
<div class="demo1">
|
||||
按钮触发:<input type="text" id="J-xl-2"><input type="button" id="J-xl-2-btn" value="打开">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="demo1">
|
||||
<label for="J-xl-3">Label触发:</label><input type="text" id="J-xl-3" >
|
||||
</div>
|
||||
|
||||
<div class="demo1">
|
||||
直接传dom:<input type="text" id="J-xl-4" >
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../laydate.js"></script>
|
||||
<script type="text/javascript">
|
||||
laydate({
|
||||
elem: '#J-xl',
|
||||
format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
|
||||
choose: function(datas){
|
||||
console.log(datas);
|
||||
}
|
||||
});
|
||||
|
||||
// document.getElementById('J-xl-2-btn').onclick = function(){
|
||||
// laydate({
|
||||
// elem: '#J-xl-2'
|
||||
// });
|
||||
// }
|
||||
|
||||
// laydate({
|
||||
// elem: '#J-xl-3'
|
||||
// });
|
||||
|
||||
// laydate({
|
||||
// elem: document.getElementById('J-xl-4')
|
||||
// });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Demo2 for Seajs</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px;"></div>
|
||||
|
||||
<input type="text" id="J-xl">
|
||||
|
||||
<script type="text/javascript" src="//libs.useso.com/js/seajs/2.2.1/sea.js"></script>
|
||||
<script type="text/javascript" src="../laydate.dev.js"></script>
|
||||
<script type="text/javascript">
|
||||
seajs.use('./demo2');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,7 @@
|
|||
define(function(){
|
||||
'use strict';
|
||||
|
||||
laydate({
|
||||
elem: '#J-xl'
|
||||
});
|
||||
});
|
|
@ -1,6 +0,0 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
URL=http://www.layui.com/laydate/
|
||||
IDList=
|
||||
HotKey=0
|