mirror of https://github.com/layui/laydate
5.0.3
parent
e0f5c6f312
commit
44a0847074
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
package.json
21
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "layui-laydate",
|
"name": "layui-laydate",
|
||||||
"version": "5.0.2",
|
"version": "5.0.3",
|
||||||
"alias": "laydate",
|
"alias": "laydate",
|
||||||
"description": "日期与时间组件",
|
"description": "日期与时间组件",
|
||||||
"main": "src/laydate.js",
|
"main": "src/laydate.js",
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "https",
|
"type": "https",
|
||||||
"url": "https://github.com/sentsin/laydate.git"
|
"url": "git+https://github.com/sentsin/laydate.git"
|
||||||
},
|
},
|
||||||
"author": "贤心",
|
"author": "贤心",
|
||||||
"homepage": "http://www.layui.com/laydate/",
|
"homepage": "http://www.layui.com/laydate/",
|
||||||
|
@ -21,5 +21,20 @@
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-header": "^1.8.8",
|
"gulp-header": "^1.8.8",
|
||||||
"del": "^2.2.2"
|
"del": "^2.2.2"
|
||||||
}
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/sentsin/laydate/issues"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"keywords": [
|
||||||
|
"laydate",
|
||||||
|
"date",
|
||||||
|
"time",
|
||||||
|
"datetime",
|
||||||
|
"datepicker",
|
||||||
|
"calendar"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@Name : layDate 5.0.2 日期时间控件
|
@Name : layDate 5.0.3 日期时间控件
|
||||||
@Author: 贤心
|
@Author: 贤心
|
||||||
@Site:http://www.layui.com/laydate/
|
@Site:http://www.layui.com/laydate/
|
||||||
@License:MIT
|
@License:MIT
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
,laydate = {
|
,laydate = {
|
||||||
v: '5.0.2'
|
v: '5.0.3'
|
||||||
,config: {} //全局配置项
|
,config: {} //全局配置项
|
||||||
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
||||||
,path: ready.getPath
|
,path: ready.getPath
|
||||||
|
@ -945,7 +945,6 @@
|
||||||
,options = that.config, timestrap = {}
|
,options = that.config, timestrap = {}
|
||||||
,dateTime = options[index > 41 ? 'endDate' : 'dateTime']
|
,dateTime = options[index > 41 ? 'endDate' : 'dateTime']
|
||||||
,isOut, thisDateTime = lay.extend({}, dateTime, date || {});
|
,isOut, thisDateTime = lay.extend({}, dateTime, date || {});
|
||||||
|
|
||||||
lay.each({
|
lay.each({
|
||||||
now: thisDateTime
|
now: thisDateTime
|
||||||
,min: options.min
|
,min: options.min
|
||||||
|
@ -1118,12 +1117,18 @@
|
||||||
lay.each(new Array(15), function(i){
|
lay.each(new Array(15), function(i){
|
||||||
var li = lay.elem('li', {
|
var li = lay.elem('li', {
|
||||||
'lay-ym': yearNum
|
'lay-ym': yearNum
|
||||||
});
|
}), ymd = {year: yearNum};
|
||||||
yearNum == listYM[0] && lay(li).addClass(THIS);
|
yearNum == listYM[0] && lay(li).addClass(THIS);
|
||||||
li.innerHTML = yearNum + text;
|
li.innerHTML = yearNum + text;
|
||||||
ul.appendChild(li);
|
ul.appendChild(li);
|
||||||
|
if(yearNum < that.firstDate.year){
|
||||||
that.limit(lay(li), {year: yearNum}, index);
|
ymd.month = options.min.month;
|
||||||
|
ymd.date = options.min.date;
|
||||||
|
} else if(yearNum > that.firstDate.year){
|
||||||
|
ymd.month = options.max.month;
|
||||||
|
ymd.date = options.max.date;
|
||||||
|
}
|
||||||
|
that.limit(lay(li), ymd, index);
|
||||||
yearNum++;
|
yearNum++;
|
||||||
});
|
});
|
||||||
lay(elemYM[isCN ? 0 : 1]).attr('lay-ym', (yearNum - 8) + '-' + listYM[1])
|
lay(elemYM[isCN ? 0 : 1]).attr('lay-ym', (yearNum - 8) + '-' + listYM[1])
|
||||||
|
@ -1132,12 +1137,16 @@
|
||||||
lay.each(new Array(12), function(i){
|
lay.each(new Array(12), function(i){
|
||||||
var li = lay.elem('li', {
|
var li = lay.elem('li', {
|
||||||
'lay-ym': i
|
'lay-ym': i
|
||||||
});
|
}), ymd = {year: listYM[0], month: i};
|
||||||
i + 1 == listYM[1] && lay(li).addClass(THIS);
|
i + 1 == listYM[1] && lay(li).addClass(THIS);
|
||||||
li.innerHTML = lang.month[i] + (isCN ? '月' : '');
|
li.innerHTML = lang.month[i] + (isCN ? '月' : '');
|
||||||
ul.appendChild(li);
|
ul.appendChild(li);
|
||||||
|
if(listYM[0] < that.firstDate.year){
|
||||||
that.limit(lay(li), {year: listYM[0], month: i}, index);
|
ymd.date = options.min.date;
|
||||||
|
} else if(listYM[0] > that.firstDate.year){
|
||||||
|
ymd.date = options.max.date;
|
||||||
|
}
|
||||||
|
that.limit(lay(li), ymd, index);
|
||||||
});
|
});
|
||||||
lay(elemYM[isCN ? 0 : 1]).attr('lay-ym', listYM[0] + '-' + listYM[1])
|
lay(elemYM[isCN ? 0 : 1]).attr('lay-ym', listYM[0] + '-' + listYM[1])
|
||||||
.html(listYM[0] + text);
|
.html(listYM[0] + text);
|
||||||
|
@ -1704,8 +1713,12 @@
|
||||||
//选择年月
|
//选择年月
|
||||||
lay(header[2]).find('span').on('click', function(e){
|
lay(header[2]).find('span').on('click', function(e){
|
||||||
var othis = lay(this)
|
var othis = lay(this)
|
||||||
,layYM = othis.attr('lay-ym').split('-')
|
,layYM = othis.attr('lay-ym')
|
||||||
,layType = othis.attr('lay-type');
|
,layType = othis.attr('lay-type');
|
||||||
|
|
||||||
|
if(!layYM) return;
|
||||||
|
|
||||||
|
layYM = layYM.split('-');
|
||||||
|
|
||||||
that.listYM[i] = [layYM[0] | 0, layYM[1] | 0];
|
that.listYM[i] = [layYM[0] | 0, layYM[1] | 0];
|
||||||
that.list(layType, i);
|
that.list(layType, i);
|
||||||
|
|
Loading…
Reference in New Issue