cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in table

Former Member
0 Kudos

Hi Experts,

I have a table. In that i want to change the date format.Presently i have the date format of mm/dd/yyyy.But i need the format of dd/mm/yyyy.I have more than one value in tha table..Help me pls.

thanks in advance

Reg

Kiruba.R

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi raman,

Is your problem solved ? If still you are looking for help, please let me know if you are binding a value attribute to the date column in your table or using direct binding to the model attribute ?

If you are using a value attribute (whose data type is simple type with the required date format), you can use this code to fill the value node from the model node. Say your date attribute joindate is under the value node empdata -


// get the size of the model node from which you are filling the data...

int count = wdContext.nodeIt_ZEmpData().size();

for(int i=0;i<count;i++)

{

//Create an element for your value node.

IWDNodeElement elem = wdContext.nodeEmpDate.createElement();

//Read the date value from model node and assign to your value attribute

elem.setAttributeValue("JoinDate", wdContext.nodeIt_ZEmpData().getIt_ZEmpDataElementAt(i).getJoinDate());

}

Note : in setAttribute... method the first argument is the name of your value attribute (used for date) and the second argument is the date value read from the model attribute....

Regards

Ramesh.

Former Member
0 Kudos

Hi Prajakta,

I done that only. Am having the two columns.Start date ans end date.I have binded the value from backend.but my row count is four. All the rows displaying the first row values.

For ex.am getting like this

Start date End Date .......but i need it like this Start date End date

4/12/2007 3/7/2008 4/12/2007 3/7/2008

4/12/2007 3/7/2008 3/3/2004 2/3/2005

4/12/2007 3/7/2008 -


4/12/2007 3/7/2008

Please help me

regards

kiruba

snehal_kendre
Active Contributor
0 Kudos

Hi,

this is happening because your backend values are over writing your context(to whom simple type is attched) which is assigned to date column.

Are you using a value node for displaying table?

if yes then when you copy your values from model node to value node. iterate model node and copy all the data values in your context os simple type.

just assigning it to a table will always over write values

Former Member
0 Kudos

hi prajakta,

Explain it clearly pls.I am not getting this.

Reg

Kiruba

Former Member
0 Kudos

Hi ,

You can change the date format to dd-mm-yyyy by changing the language settings of your desktop.

goto ->control panel ->Regional & Language Options and change the language to Englisk UK and save the settings.

hope this will solve your problem.

Regards,

Sunitha Hari

Former Member
0 Kudos

Hi,

The column of the table where in you are going to fetch date must be assigned to certain attribute .To the type of that attribute give simple type.which you have created.\

Regards

Prajakta

Former Member
0 Kudos

Hi ,

I tried in simple data type..In my table more than one value is there. all the row value are displayed the same values,i.e the current selection values.

But the date from backend is different for each row.

Former Member
0 Kudos

Hi,

Assign simple type directly to column attribute which is coming from backend.

Regards

Prajakta

Former Member
0 Kudos

Hi,

Create simple type..Go to Representation tab.And In format give dd.MM.yyyy.

Assign this to column attribute's type.

Ragards

Prajakta

Former Member
0 Kudos

Hi,

1)Create a dictionary type and bind this to the table column

2)specify the format as part of the type.

Regards

Ayyapparaj

Former Member
0 Kudos

hi,

if you want to take a date from the form and set into the table in dd/mm/yyyy.

do the following

take a value attribute of type string in table node.

and use the below code to set the date formate,

SimpleDateFormat formatDate = new SimpleDateFormat ("dd/mm/yyyy");

String stringDate = formatDate .format (wdContext.getDate());

and set the " stringDate " to table attribute.

Regards,

ramesh

Former Member
0 Kudos

Hi kiruba,

Use the following code


 
  SimpleDateFormat fSDateFormat = new SimpleDateFormat ("dd/mm/yyyy");
   Date now = new Date ();
    String date_out = fSDateFormat.format (now);

Regards,

P.Manivannan