cancel
Showing results for 
Search instead for 
Did you mean: 

Calendar UI element

Former Member
0 Kudos

I want to display a calendar in my application....I want to display 3 months of the calendar on d screen..i have set the months per row property 4 that... i want

2 display current mon in the middle i.e it shud display previous mon,current mon n d next mon....

for that i bind the property startsWith to a context...

How to set that context to the previous mon, basically how to get previous month's value....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

You can use the following solution.

Date curr = new Date(System.currentTimeMillis());

int year = curr.getYear();

int month = curr.getMonth()-1;

Date curr2 = new Date(year,month,1);

wdContext.currentContextElement().setStartsWith(curr2);

wdContext.currentContextElement().setStartDate(curr);

where startsWith and startDate are the context attributes. Bind startsWith to startsWith property and startDate to firstSelectedDate property of the DateNavigator UI element.

Place the above lines of code in wdDoInit().

This will work surely.

thanks & regards,

Manoj

Answers (1)

Answers (1)

former_member304001
Active Contributor
0 Kudos
Former Member
0 Kudos

I want to get previous mon...this blog does not talk about that