on 01-11-2011 3:46 PM
Hi Experts,
In my project i have two date input fields called
1)Start Date
2)End Date
and one Absence type input field is there. The user wants to set the start Date ,End date and absence type.
How to get the user set values in my project.i.e how to get the user inputs and the started date must be current date of the system and end date must be after the 3 months.
Can any body send code regarding this.
Thanks in advance.
Regards,
Venkat.
Edited by: Venkat5939 on Jan 11, 2011 4:46 PM
Hi,
Use the blow code to get todays date and date after 3 months
Date date = new Date(System.currentTimeMillis());
wdContext.currentContextElement().setTodaysDate(date);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH,3);
wdContext.currentContextElement().setDateAfter3Months(new Date(calendar.getTimeInMillis()));
Regards,
Amol
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.
Hi VEnkat,
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
Date today = Calendar.getInstance().getTime();
String reportDate = df.format(today);
wdContext.currentContextElement().setFromDate(reportDate);
java.util.Date nextdate = DateHelper.addDays(reportDate, 90);
wdContext.currentContextElement().setToDate(nextdate);
Try this code
Regards,
Sen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Below code gives the current date. .
Date date = new Date()
use the formatter to format the date as per your requirement.
Regards
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.