cancel
Showing results for 
Search instead for 
Did you mean: 

How to set default value to date type attribute.

Former Member
0 Kudos

Hi,

How to set default value to date type attribute.

E.g I want to set u201C01/01/1999u201D to date attributes.

First i want to set value and then i want to fetch the same & want to check equals.

please suggest solution.

Regards,

Smita

Accepted Solutions (0)

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos

Hi,

In wdinit() method u can set the date

 
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
Date today = Calendar.getInstance().getTime(); 
String reportDate = df.format(today);
wdContext.currentContextElement().setFromDate(reportDate);

Another way you have set the this formate like that

1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat

2. Select the type as "date"

3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)

4.Bind the context attribute to the type created now.

Hope this helps u.

Best Regards

Vijay K

Former Member
0 Kudos

thanks Vijay..