Go to Post I was watching the webcast when that score was posted and thought to myself, "What did they do, steal a donut from Dave?" - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2010, 18:45
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Help with calendar

For the our website we need a javascript that finds out what day it is, and then writes relevant data. Our times that we meet vary, and it would be a big help!

The part that I most confused with is using the date() function. I know how to get the date, time and the sort, but am lost as to how to make the script do different document.write() according to what day it is.

Thanks!

Also check out the new site! http://arrowheadrobotics.org
  #2   Spotlight this post!  
Unread 10-01-2010, 18:59
DMetalKong's Avatar
DMetalKong DMetalKong is offline
Registered User
AKA: David K.
no team
Team Role: College Student
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Bridgewater
Posts: 144
DMetalKong is a jewel in the roughDMetalKong is a jewel in the roughDMetalKong is a jewel in the rough
Send a message via AIM to DMetalKong
Re: Help with calendar

First of all, let me point you to the w3schools website. They have a lot of useful tutorials on web-related topics - for your case they have a good date object reference.

Second, you can use the getDay() method along with a switch statement to do what you want. See below

Code:
var d = new Date();
switch(d.getDay()) {
    case 0:
        //do Sunday stuff here
        break;
    case 1:
        //do Monday stuff here
        break;
    //...
    //...
    case 6:
        //do Saturday stuff here
        break;
}
Hope that helps.

Last edited by DMetalKong : 10-01-2010 at 19:01. Reason: Fix links
  #3   Spotlight this post!  
Unread 11-01-2010, 21:59
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: Help with calendar

ok thanks! ill check out w3c
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP!!! STUCK WITH SUB ROUTINES WITH THE IR!!! drewjones13 Programming 1 17-01-2008 20:52
Event Calendar Scott Shaw 237 Website Design/Showcase 13 04-01-2004 00:35
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
Calendar LBK Rules General Forum 8 06-01-2003 21:55
calendar David Kelly CD Forum Support 2 28-07-2001 14:18


All times are GMT -5. The time now is 19:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi