Skip to content

Commit e3fa5fd

Browse files
committed
Clone selected date to preserve correct time when using setDate function.
1 parent 49f2f91 commit e3fa5fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/datetime-range.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')),
3737
'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month()
3838
}"
39-
ng-click="setDate(calendar.clone().month(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()), true)">
39+
ng-click="setDate(selected.clone().month(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()), true)">
4040
{{ calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date() }}
4141
</span>
4242
</div>

0 commit comments

Comments
 (0)