mirror of
https://github.com/uxsolutions/bootstrap-datepicker.git
synced 2026-01-25 16:46:28 +00:00
Merge pull request #1627 from laltin/patch-getter-limits
add getter methods for date limits
This commit is contained in:
commit
352c19fd4d
@ -144,6 +144,22 @@ Arguments: None
|
||||
Returns the internal list of UTC date objects, as they are and unconverted to local time, of the first datepicker in the selection. For use with multidate pickers.
|
||||
|
||||
|
||||
getStartDate
|
||||
------------
|
||||
|
||||
Arguments: None
|
||||
|
||||
Returns the lower date limit on the datepicker.
|
||||
|
||||
|
||||
getEndDate
|
||||
----------
|
||||
|
||||
Arguments: None
|
||||
|
||||
Returns the upper date limit on the datepicker.
|
||||
|
||||
|
||||
setStartDate
|
||||
------------
|
||||
|
||||
|
||||
8
js/bootstrap-datepicker.js
vendored
8
js/bootstrap-datepicker.js
vendored
@ -623,6 +623,10 @@
|
||||
return DPGlobal.formatDate(d, format, lang);
|
||||
}).join(this.o.multidateSeparator);
|
||||
},
|
||||
|
||||
getStartDate: function(){
|
||||
return this.o.startDate;
|
||||
},
|
||||
|
||||
setStartDate: function(startDate){
|
||||
this._process_options({startDate: startDate});
|
||||
@ -630,6 +634,10 @@
|
||||
this.updateNavArrows();
|
||||
return this;
|
||||
},
|
||||
|
||||
getEndDate: function(){
|
||||
return this.o.endDate;
|
||||
},
|
||||
|
||||
setEndDate: function(endDate){
|
||||
this._process_options({endDate: endDate});
|
||||
|
||||
@ -92,6 +92,24 @@ test('setEndDate', function(){
|
||||
strictEqual(returnedObject, this.dp, "is chainable");
|
||||
});
|
||||
|
||||
test('getStartDate', function(){
|
||||
var date_in = new Date(Date.UTC(2012, 3, 5)),
|
||||
expected_date = date_in,
|
||||
returnedObject = this.dp.setStartDate(date_in);
|
||||
// ...
|
||||
datesEqual(returnedObject.getStartDate(), expected_date);
|
||||
strictEqual(returnedObject, this.dp, "is chainable");
|
||||
});
|
||||
|
||||
test('getEndDate', function(){
|
||||
var date_in = new Date(Date.UTC(2012, 3, 5)),
|
||||
expected_date = date_in,
|
||||
returnedObject = this.dp.setEndDate(date_in);
|
||||
// ...
|
||||
datesEqual(returnedObject.getEndDate(), expected_date);
|
||||
strictEqual(returnedObject, this.dp, "is chainable");
|
||||
});
|
||||
|
||||
test('setDaysOfWeekDisabled - String', function(){
|
||||
var days_in = "0,6",
|
||||
expected_days = [0,6],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user