Welcome Guest   | Login   
  Search  
  Index |  Recent Threads |  Register | 


Quick Go »
Thread Status: Normal
Total posts in this thread: 8
[Change thread status] [Delete this Thread] [Move this Thread]
[Add To My Favorites] [Watch this Thread] [Post new Thread]
Author
Previous Thread This topic has been viewed 175 times and has 7 replies Next Thread
TravisTigerBand
New Member
Member's Avatar


Joined: Jun 6, 2007
Posts: 6
Status: Offline
Edit this Post   One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Thread]

Hi,
This is a newbie JavaScript Question.
I'm using the list format W1.
Is there a easy way to do a one week look ahead from the current week?
I want to see NEXT week's events.
I'm hoping someone has already written something.
Thanks
-BB-
[May 25, 2008, 1:13:38 AM] [64.91.199.147] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
jamiecd77
Veteran
Member's Avatar


Joined: Oct 25, 2006
Posts: 77
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

I think we can handle that....

try adding the start date criteria to your link/code.

for example

http://www.localendar.com/public/travistigerband?style=W1&start_date=6/1/2008

When using the W1 style, the start date tells your calendar what week to display, The above example will actually start on the second, If you change the date to 6/3/2008, it will still start on the second.

hope that helps,

Jamie
----------------------------------------
Peer-Support Specialist
----------------------------------------
[Edit 1 times, last edit by jamiecd77 at May 26, 2008, 3:51:36 AM]
[May 26, 2008, 3:50:41 AM] [First IP: 68.204.203.225 - Last IP: 68.204.203.225] Show Post Printable Version    http://www.djjamie.com [Link] Report threatening post: please login first  Go to top 
TravisTigerBand
New Member
Member's Avatar


Joined: Jun 6, 2007
Posts: 6
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

Hello again.

Thanks Jamie.

Using the date in the string I understand.

However, I want to dynamically change the date in the JS String to be 7 days from now.

Example:
If today were 6/1/2008, I want to present for 6/8/2008
If today were 6/8/2008, I want to present for 6/15/2008

Like the way the month forward button works but for a 1 week increment.

I've looked into the set.date method, but I don't know how to push and/or pull the new date into the W1 string.

crying

Thanks
-BB-
[May 27, 2008, 1:05:09 PM] [141.197.12.183] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
jamiecd77
Veteran
Member's Avatar


Joined: Oct 25, 2006
Posts: 77
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

Alack, I think you are going to have to code that yourself...There is no method that I know of in Localendar to call "next week" from the initial published calendar.

Of course, the arrows on the top and bottom automatically go to next week, but I think the publishjump routine the arrows use is a lookup table...

Marc, ideas?
----------------------------------------
Peer-Support Specialist
[May 28, 2008, 5:38:58 PM] [68.204.203.225] Show Post Printable Version    http://www.djjamie.com [Link] Report threatening post: please login first  Go to top 
TravisTigerBand
New Member
Member's Avatar


Joined: Jun 6, 2007
Posts: 6
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

I found something...
I can build the string, but how do I get the scr to accept it?

<html>
<body>

<script type="text/javascript">

var today = new Date();

today.setDate(today.getDate()+7)

var theMonth = today.getMonth()+1;
var theDay = today.getDate();
var theYear = today.getYear();
var thestring ="http://www.localendar.com/public/travistigerband?include=Y&style=W1&start_date="+(theMonth + "/" + theDay + "/" + theYear);



document.write (thestring);


</script>

<SCRIPT language="Javascript" src= thestring > </SCRIPT>

</body>
</html>
[May 29, 2008, 9:16:01 AM] [141.197.12.183] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
support
localendar Expert
Member's Avatar


Joined: Aug 9, 2022
Posts: 6437
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

How's about something like this?

<html>
<body>

<script type="text/javascript">
var today = new Date();

today.setDate(today.getDate()+7)

var theMonth = today.getMonth()+1;
var theDay = today.getDate();
var theYear = today.getYear();
var thestring =
"http://www.localendar.com/public/travistigerband?include=Y&style=W1&start_date="+(theMonth + "/" + theDay + "/" + theYear);

function staticLoadScript(url)
{
document.write('<script src="', url, '" type="text/javascript"><\/script>');
}

staticLoadScript(thestring);

</script>

</body>
</html>

----------------------------------------
Marc Higgins
Support Associate, localendar.com
Follow us on Twitter! http://www.twitter.com/localendar_news
----------------------------------------
[Edit 1 times, last edit by support at May 30, 2008, 12:08:52 AM]
[May 30, 2008, 12:08:08 AM] [First IP: 67.86.148.33 - Last IP: 67.86.148.33] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
TravisTigerBand
New Member
Member's Avatar


Joined: Jun 6, 2007
Posts: 6
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

Sweet!
Thank you! biggrin

[May 30, 2008, 7:48:40 AM] [141.197.12.183] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
TravisTigerBand
New Member
Member's Avatar


Joined: Jun 6, 2007
Posts: 6
Status: Offline
Edit this Post   Re: One week look ahead... how do I do that on the W1 Style Reply to this Post
Reply with Quote
[Delete this Post]

One issue appeared in Firefox and Safari... The string HAS to be MM/DD/YY.

Cheap and dirty fix... (Ugly!)

if (theMonth < 10)
{
theMonth = "0"+ theMonth.toString()
}


if (theDay < 10)
{
theDay = "0"+ theDay.toString()
}


theYear = theYear - 2000

if (theYear < 10)
{
theYear = "0"+ theYear.toString()
}


Got a better way?

-BB-
[May 30, 2008, 11:56:59 PM] [64.91.199.147] Show Post Printable Version [Link] Report threatening post: please login first  Go to top 
[Show Thread Printable Version] [Post new Thread]

Help! | Cobranding | Legal | Privacy Policy | About localendar.com | Contact Us