cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 two Calendars setter and getter Issues

former_member614481
Participant
0 Kudos

Hello,

look the Code below

this.byId("FirstCalendar").getDateValue().getMonth()
3
this.byId("SecondCalendar").getDateValue().getMonth()
3
this.byId("SecondCalendar").getDateValue().setMonth(this.byId("FirstCalendar").getDateValue().getMonth()+3)
1627084800000
this.byId("SecondCalendar").getDateValue().getMonth()
6
this.byId("FirstCalendar").getDateValue().getMonth()
6

.setMonth, changes the month of both Calendars for no reason.

Why do you think that is the Case?

Accepted Solutions (0)

Answers (1)

Answers (1)

mvaibhav
Contributor
0 Kudos

Hi Roman,

Which control are you using for Calendar ?

I tried the same for DatePicker control and it works as expected.

Only the month of secondDatePicker is updated.

May be you were testing the output using browser console and reference of first calendar was updated by your code as well.

Thanks,

Vaibhav