CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

end date beginning at start date

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related
View previous topic :: View next topic  
Author Message
Bob Herzog



Joined: 11 Aug 2005
Posts: 3

PostPosted: Wed Aug 24, 2005 4:12 pm    Post subject: end date beginning at start date Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Wed Aug 24, 2005 8:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bob Herzog



Joined: 11 Aug 2005
Posts: 3

PostPosted: Thu Aug 25, 2005 12:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bob Herzog



Joined: 11 Aug 2005
Posts: 3

PostPosted: Thu Aug 25, 2005 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Thu Aug 25, 2005 7:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group