View previous topic :: View next topic |
Author |
Message |
Bob Herzog
Joined: 11 Aug 2005 Posts: 3
|
Posted: Wed Aug 24, 2005 4:12 pm Post subject: end date beginning at start date |
|
|
I have an application that uses a date range to select historical data. Since this range can go back several years and maybe only select one or two months of data, I want to set the end-date calendar to begin with the date selected for the start. This can save a user from having to scroll back through several years to get where they want.
Please, how do I accomplish this? I can become a hero with the answer.
_________________ Bob Herzog
Southwest Florida Water Management District |
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Wed Aug 24, 2005 8:51 pm Post subject: |
|
|
The easiest way is to set the end-date whenever the user picks a start-date. e.g. assuming you are using the DateRange demo, please go into the plugins.js and modify the fAfterSelected() function as following:
Code: | function fAfterSelected(y,m,d,e) {
if (gdCtrl==_startc) {
_endc.value=fFormatInput(y,m,d);
}
} |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
Bob Herzog
Joined: 11 Aug 2005 Posts: 3
|
Posted: Thu Aug 25, 2005 12:59 pm Post subject: |
|
|
Thank you. This answered the first part of my problem. I didn't state the full situation.
I only want to change the end date if an end date has not already been selected.
I'm trying to test the _endc.value for null or " " or "" but none seem to work.
Code: | function fAfterSelected(y,m,d,e) {
if (gdCtrl==_startc) {
if (_endc.value==""){
_endc.value=fFormatInput(y,m,d);
}
}
} |
_________________ Bob Herzog
Southwest Florida Water Management District |
|
Back to top |
|
|
Bob Herzog
Joined: 11 Aug 2005 Posts: 3
|
Posted: Thu Aug 25, 2005 4:41 pm Post subject: |
|
|
The code posted before works correctly. For whatever reason, I had to shut down Visual Studio and restart before the code worked.
Thanks for the help.
_________________ Bob Herzog
Southwest Florida Water Management District |
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Thu Aug 25, 2005 7:23 pm Post subject: |
|
|
You're welcome. You need to clear the cache after making changes to *.js file because they are by default cached by most browsers.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
|