cancel
Showing results for 
Search instead for 
Did you mean: 

user-defined calendar

Former Member
0 Kudos

Hi,

when binding a date type to a inputfiled, we will get a valuehelp with a calendar. clicking it will display the current month. If I want to display the other month( example: It's April now. I want to display next year's April).

How can I do?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you for everyone.

But I really means that, I want to modify the calendar's valuehelp.It default display current month, can make it display another month when I click the icon in the inputfield?

Former Member
0 Kudos

Hi ,

You can change the months value and that months calendar ill be displayed.

java.sql.Date sqlDate = java.sql.Date.valueOf( "2008-05-01" );

// above stmt 2008 May calender will be displayed

wdcontext.curretContextElement.setDate(sqlDate);

Regards,

Sunitha Hari

Former Member
0 Kudos

Hi,

But I really means that, I want to modify the calendar's valuehelp.It default display current month, can make it display another month when I click the icon in the inputfield?

When you click on the icon calendar is displayed based on the value which is available in the text box or else the default one. If you want this to change to that of yours you need to set the value as part of the context attribute bound to this inputfield, to do this pl refer my prev post.

Regards

Ayyapparaj

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you everyone!

I have solved this issue

Former Member
0 Kudos

Hi,

You can use the following code to acheive your requirement


Calendar.getInstance().set(Calendar.MONTH, 4);
	  Calendar.getInstance().set(Calendar.YEAR, 2008);
	  Date dt = new Date(Calendar.getInstance().getTimeInMillis());
//Align the following code to that of your context attribute.
	  wdContext.currentContextElement().setDate(dt);

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ,

If ur value Attribute is date , assign initial value as next years date, then next years calender ill be displayed.

java.sql.Date sqlDate = java.sql.Date.valueOf( "2008-04-01" );

wdcontext.curretContextElement.setDate(sqlDate);

Regards,

Sunitha Hari

Former Member
0 Kudos

Hi Vinny,

I hope you have seen the month and year navigation panel on the pop up calendar. You can use to get next year.

Or if you want to do it through code, you can use the Calendar/ Date Class and set date to the Calendar/Date Object and assign this to the InputField.

Its simple.

Regards

- Vinod

Edited by: Vinod V on Apr 1, 2008 1:12 PM