|
CalendarXP.net Support Most forums here are private and invisible to public.
|
View previous topic :: View next topic |
Author |
Message |
woogo
Joined: 05 Aug 2005 Posts: 2
|
Posted: Fri Aug 05, 2005 12:51 pm Post subject: Set the end of date range to be 1 day later than the start |
|
|
Hello,
we use your PopCalendarXP on booking accomodation website.
I was wondering, if there is a way to prevent people from selecting same dates in both fields, as this makes the search invalid.
I am thinking about something like: if I select (or preselect) arrive date, the departure date would be available from that date+1 day.
Tomek
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Fri Aug 05, 2005 1:49 pm Post subject: |
|
|
Yes, possible and easy. Just go to the plugins.js of the daterange demo and modify the fEndPop() to be like the following:
Code: | function fEndPop(startc,endc) {
_startc=startc;
_endc=endc;
var sd=fParseInput(startc.value);
if (!sd) sd=gBegin;
var dt=new Date(sd[0],sd[1]-1,sd[2]+1);
sd[0]=dt.getFullYear();
sd[1]=dt.getMonth()+1;
sd[2]=dt.getDate();
fPopCalendar(endc, [sd,gEnd,sd]);
} |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
woogo
Joined: 05 Aug 2005 Posts: 2
|
Posted: Fri Aug 05, 2005 2:07 pm Post subject: |
|
|
that's great, thank you
|
|
Back to top |
|
|
|
|
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
|