on 09-25-2008 6:20 PM
Hi Experts,
i'm having a problem with date
1.i created attribute called From of Type Date
2.Binded with input field
3.by default it taking system date month year ......dd-mm-yyyy......25-09-2008
My problem is
i want to set that date to some other DD-mm-yyyy 01-01-2008 plz give me some solution
Hi,
try this,
Calendar calendar = new GregorianCalendar(2008, 0, 1);
Date date = new Date(calendar.getTimeInMillis());
SimpleDateFormat f = new SimpleDateFormat("dd-MM-yyyy");
String formatedDate=f.format(date);
wdComponentAPI.getMessageManager().reportSuccess("the date"+formatedDate);
formatedDate will give 01-01-2008.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ramesh
i tried with your code .....i got some what i expected but....................... i'm not having option to select any date from that month ........?.
what i'm expecting is ...i want to select any date from that month not exactly particular date that is 01-01-2008
That date field must start with 01-01-2008 ..... can we able to select any date in that month .......01-2008
Is it possible .....? please Give me some solutions
thank's and Regards
ram
i
Edited by: Ramprasad K on Sep 26, 2008 9:25 PM
Ramprasad,
Did you try this..
public void wdDoInit()
{
//@@begin wdDoInit()
Calendar calendar = new GregorianCalendar(2008, 0, 1);
Date date = new Date(calendar.getTimeInMillis());
wdContext.currentContextElement().setFrom(date);
//@@end
}
This will start the date at 01/01/2008 and user should be able to select any date.
Hope this helps.
Vishwas.
Thank you all ....for Sharing ideas to solve my problem .....
Thank you And REGARDS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use following ways to achieve this:
create a simple type; define your date format and use it.
change the locale of the user; to Australian/UK and it will change accordingly.
regards
Jawed Ali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In Dictioanry Create a simple data type of Type Date ,and in the representation part of Simpe data type give the Format which you want eg:-dd-MM-yyyy
Then come to the context and give the type of it as the variable in the context as the variable which you created in the dictioanry.
Then your problem will be solved
Regards,
Padma N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi....can u try with function modules
HR_IN_GET_DATE_COMPONENTS
It gives you day , month, year in seperate variable...
U can process it as per requirements
I hope ..it is useful
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ramprasad,
Use this code to default the date to January 1st, 2001. From is the context attribute bound to your InputField.
public void wdDoInit()
{
//@@begin wdDoInit()
Calendar calendar = new GregorianCalendar(2001, 0, 1);
Date date = new Date(calendar.getTimeInMillis());
wdContext.currentContextElement().setFrom(date);
//@@end
}
Hope it helps.
Vishwas.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.