on 09-12-2008 5:30 AM
hai every one,
i want develop two date fileds.
i taken two input fields like date1 and date2 and given type as Date.
here the date input format is like mm/dd/yyyy, but i want to change to dd/mm/yyyy.
And i want to maintain condition like date2 >= date1.
if it is wrong i need to show error.
Hi,
This is an addition to nihils thread.
Format formatter = new SimpleDateFormat("MMM dd,yyyy");
formatter.format(wdContext.nodexxxx().getXX.getAssig_Date())
Thanks & Regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
To Get the Date in your required format use SimpleDateFormatter
public Date getDate(String dateString)
{
// TODO : Implement
java.util.Date d= null;
SimpleDateFormat FORMATTER = new SimpleDateFormat("dd.MM.yyyy");
try
{
d = FORMATTER.parse(dateString);
}
catch (ParseException e)
{
wdComponentAPI.getMessageManager().reportException("Unable to do operation, error is:"+e,true);
}
return new Date(d.getTime());
}
You can use above method to format you date ...
Now if you want to compare the dates
methods like after ,before ,equals are available on the date.
But date1.equals(date2) will return true only when the time of
the two dates are equals(i.e it see hrs,min,sec,milliseconds..)etc
If this is the requirement of you You can use it.
But You just want to compare the Dates are equal,
Then you have to go for the Calender Object ....
If any queries or more help needed reply back
Regards
Madhavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try this it is more usefull
SimpleDateFormat fSDateFormat = new SimpleDateFormat ("dd/MM/yyyy");
Date now = new Date ();
mdr.reportSuccess(now.toString());
String date_out = fSDateFormat.format (now);
mdr.reportSuccess(date_out.toString());
Thanks & Regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Go to dictionaries.
2. There, in Simple Types, create a new simple type , eg. ca_Data1, ca_Date2.
3. After creating, there is a format field where you can define the format of date as required.
for validation of Date2 >= Date1 , write the following code :-
if((wdcontext.node ***. current (node) element.get date1) < (wdcontext.node ***. current (node) element.get date))
{
wdcomponentAPI.getmessagemanager.reportexception("condition wrong",false);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eswar, you could use a InputField UI element and map it to a Context Element of type Date. This would allow the user to pick dates. Post this on some action you will have to use the java date API to do the checks you require.
Thanks,
GLM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.