Skip to content

Commit

Permalink
Fix #1144, fix #1153
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrossman committed Jun 30, 2016
1 parent a58f32d commit 94eeb2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
21 changes: 13 additions & 8 deletions daterangepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @version: 2.1.23-beta
* @version: 2.1.23
* @author: Dan Grossman http://www.dangrossman.info/
* @copyright: Copyright (c) 2012-2016 Dan Grossman. All rights reserved.
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -849,6 +849,10 @@

renderTimePicker: function(side) {

// Don't bother updating the time picker if it's currently disabled
// because an end date hasn't been clicked yet
if (side == 'right' && !this.endDate) return;

var html, selected, minDate, maxDate = this.maxDate;

if (this.dateLimit && (!this.maxDate || this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)))
Expand All @@ -858,15 +862,9 @@
selected = this.startDate.clone();
minDate = this.minDate;
} else if (side == 'right') {
selected = this.endDate ? this.endDate.clone() : this.previousRightTime.clone();
selected = this.endDate.clone();
minDate = this.startDate;

if (selected.isBefore(this.startDate))
selected = this.startDate.clone();

if (maxDate && selected.isAfter(maxDate))
selected = maxDate.clone();

//Preserve the time already selected
var timeSelector = this.container.find('.calendar.right .calendar-time div');
if (!this.endDate && timeSelector.html() != '') {
Expand All @@ -884,6 +882,13 @@
}

}

if (selected.isBefore(this.startDate))
selected = this.startDate.clone();

if (maxDate && selected.isAfter(maxDate))
selected = maxDate.clone();

}

//
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'dangrossman:bootstrap-daterangepicker',
version: '2.1.22',
version: '2.1.23',
summary: 'Date range picker component for Bootstrap',
git: 'https://github.com/dangrossman/bootstrap-daterangepicker',
documentation: 'README.md'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-daterangepicker",
"version": "2.1.22",
"version": "2.1.23",
"description": "Date range picker component for Bootstrap",
"main": "daterangepicker.js",
"style": "daterangepicker.css",
Expand Down

1 comment on commit 94eeb2b

@pedramphp
Copy link
Contributor

@pedramphp pedramphp commented on 94eeb2b Jul 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangrossman the fix is not pushed to NPM. can you please push it.

Thanks,
Mahdi

Please sign in to comment.