Skip to content

Commit a45a4aa

Browse files
committed
Copy calendar date year when setting the date after multiple year cycle.
1 parent 8aea8ec commit a45a4aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/date-input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')),
2828
'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month()
2929
}"
30-
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)">
30+
ng-click="setDate(selected.clone().year(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).year()).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)">
3131
{{ calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date() }}
3232
</span>
3333
</div>

src/datetime-input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')),
3030
'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month()
3131
}"
32-
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)">
32+
ng-click="setDate(selected.clone().year(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).year()).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)">
3333
{{ calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date() }}
3434
</span>
3535
</div>

0 commit comments

Comments
 (0)