cancel
Showing results for 
Search instead for 
Did you mean: 

regarding date formatting

Former Member
0 Kudos

Hi Forum

I have a date input field in which i hv set its format to dd/mm/yyyy, now when a date is entered like dd/mm/yy for ex 3/2/07 it takes it as 03/02/0007 hence proving no results on the next screen. How can I handle this problem?

Thanks & Regards

Jaspreet Kaur Grewal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This seems to be desired behaviour from NW as you are entering only the two digits how can the system think that it can be 2007?. Why not 1007 or 3007?

So i dont think by default, it will treat 07 as 2007.

Regards

Ayyapparaj

Former Member
0 Kudos

If 2 digits are entered for year then it by default takes as 0007 but then if i want to provide a error if 2 digits r entered for the year how can i do tht.I mean to say if user enters 2 digits for year how can i chk tht and throw the error, as it will append 00 as my format is set to dd/mm/yyyy.

Thanks & Regards

Jaspreet Kaur

Former Member
0 Kudos

Hi,

Create a calculate attribute and then bind to this field

Ex:

Create a calculated attribute of type date.

In the setter of this method you will have a parameter called value which returns the value entered by the user.

Based on this you can create your message or else a context exception.

Regards

Ayyapparaj

Former Member
0 Kudos

Hey create a attribute(value or modal)any provide the data type as 'date' (by default it is string).So if the user enters any wrong value then the system is going to take care of the validations.