on 12-23-2010 12:17 PM
Hi,
Scenario 1:
Can anybody please tell me hoe to display Date using Date pIcker in date format i.e ("23-Aug-2010").
Whenver user selects Date from Date picker, date shud be displayed in ("23-Aug-2010") mention format.
Scenario 1:
How to specify the Date range to restrict date only for 32 days betweeen FromDate to Todate i.e difference between FromDate and Todate should not be greater then 32 days considering Scenario1 Date..
Kindly guide.
Thanks & Regards,
SK
Hi,
Please have a look at this thread for the date format in date picker
For scenario 2.
You can find the difference between two dates. If it exceeds the 32, you can raise the message
Please have a look at the following threads
http://www.jguru.com/forums/view.jsp?EID=489372
Kind regards
Saravanan K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SK,
scenario1
take calender date and process this date using code like this below -
Calendar payDate;
payDate = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy");
dateFormat.format(payDate.getDate()));
scenario 2
take two calender instances in two parametes and calculate the diff. below is code -
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
long milis1 = cal1.getTimeInMillis();
long milis2 = cal2.getTimeInMillis();
long diff = milis2 - milis1;
long diffDays = diff / (24 * 60 * 60 * 1000);
hope it helps.
Regards,
Sen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.