Skip to content

Commit f251706

Browse files
committed
Merge pull request #148 from holtkamp/patch-time-support-for-workweek-and-weekend
Support for time changing when in 'workweek' or 'weekend' batchmode
2 parents 5626082 + e3ce343 commit f251706

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

jquery.daterangepicker.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,6 @@
11581158
{
11591159
opt.start = time;
11601160
opt.end = false;
1161-
if (opt.time.enabled) {
1162-
changeTime("start", opt.start);
1163-
}
11641161
}
11651162
else if (opt.batchMode === 'week')
11661163
{
@@ -1191,9 +1188,6 @@
11911188
{
11921189
opt.start = handleStart(time);
11931190
opt.end = false;
1194-
if (opt.time.enabled) {
1195-
changeTime("start", opt.start);
1196-
}
11971191
}
11981192
else if (opt.start)
11991193
{
@@ -1203,6 +1197,17 @@
12031197
}
12041198
}
12051199

1200+
//Update time in case it is enabled and timestamps are available
1201+
if(opt.time.enabled) {
1202+
if(opt.start) {
1203+
changeTime("start", opt.start);
1204+
}
1205+
if(opt.end) {
1206+
changeTime("end", opt.end);
1207+
}
1208+
}
1209+
1210+
//In case the start is after the end, swap the timestamps
12061211
if (!opt.singleDate && opt.start && opt.end && opt.start > opt.end)
12071212
{
12081213
var tmp = opt.end;

0 commit comments

Comments
 (0)