You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.3 KiB
74 lines
2.3 KiB
/*
|
|
This file is part of Ext JS 3.4
|
|
|
|
Copyright (c) 2011-2013 Sencha Inc
|
|
|
|
Contact: http://www.sencha.com/contact
|
|
|
|
GNU General Public License Usage
|
|
This file may be used under the terms of the GNU General Public License version 3.0 as
|
|
published by the Free Software Foundation and appearing in the file LICENSE included in the
|
|
packaging of this file.
|
|
|
|
Please review the following information to ensure the GNU General Public License version 3.0
|
|
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
|
|
|
If you are unsure which license is appropriate for your use, please contact the sales department
|
|
at http://www.sencha.com/contact.
|
|
|
|
Build date: 2013-04-03 15:07:25
|
|
*/
|
|
Ext.ns('Ext.calendar');
|
|
|
|
(function() {
|
|
Ext.apply(Ext.calendar, {
|
|
Date: {
|
|
diffDays: function(start, end) {
|
|
day = 1000 * 60 * 60 * 24;
|
|
diff = end.clearTime(true).getTime() - start.clearTime(true).getTime();
|
|
return Math.ceil(diff / day);
|
|
},
|
|
|
|
copyTime: function(fromDt, toDt) {
|
|
var dt = toDt.clone();
|
|
dt.setHours(
|
|
fromDt.getHours(),
|
|
fromDt.getMinutes(),
|
|
fromDt.getSeconds(),
|
|
fromDt.getMilliseconds());
|
|
|
|
return dt;
|
|
},
|
|
|
|
compare: function(dt1, dt2, precise) {
|
|
if (precise !== true) {
|
|
dt1 = dt1.clone();
|
|
dt1.setMilliseconds(0);
|
|
dt2 = dt2.clone();
|
|
dt2.setMilliseconds(0);
|
|
}
|
|
return dt2.getTime() - dt1.getTime();
|
|
},
|
|
|
|
// private helper fn
|
|
maxOrMin: function(max) {
|
|
var dt = (max ? 0: Number.MAX_VALUE),
|
|
i = 0,
|
|
args = arguments[1],
|
|
ln = args.length;
|
|
for (; i < ln; i++) {
|
|
dt = Math[max ? 'max': 'min'](dt, args[i].getTime());
|
|
}
|
|
return new Date(dt);
|
|
},
|
|
|
|
max: function() {
|
|
return this.maxOrMin.apply(this, [true, arguments]);
|
|
},
|
|
|
|
min: function() {
|
|
return this.maxOrMin.apply(this, [false, arguments]);
|
|
}
|
|
}
|
|
});
|
|
})();
|