Skip to content

Commit a3ef018

Browse files
committed
Set the month first to avoid situations where date is shifted becase set date is not inside the current month.
1 parent 759090a commit a3ef018

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': selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')),
3737
'inactive': selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== selected.month()
3838
}"
39-
ng-click="setDate(selected.clone().date(selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()).month(selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()))">
39+
ng-click="setDate(selected.clone().month(selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()))">
4040
{{ selected.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date() }}
4141
</span>
4242
</div>

0 commit comments

Comments
 (0)