www.webdeveloper.com
Results 1 to 2 of 2

Thread: Links with variable endings.

  1. #1
    Join Date
    Jun 2005
    Posts
    2

    Links with variable endings.

    I don't know if this is an HTML problem or java script, or if this is even possible. I am making an HTML based program for my Shipping and Receiving section of my job. One of the files that I am trying to link to gets updated ever day. Each day the file name changes (Julian Date)-dpr.doc It would look like this 5165 DPR.doc Julian date is a calender system the military uses if you don't know. It uses the first letter to signify the year. 5 for 2005, and then the last three to signify what day of the year it is. For today (June 28, 2005) the julian would be 5179 for the 197th day of 2005. I want to see if I can make it so the html updates like a calender and each day changes the link that it would go to from 5179 dpr.doc to 5180 dpr. doc. Thank You. USMC Cpl G

  2. #2
    Join Date
    Jan 2004
    Location
    Washington DC
    Posts
    1,107
    Hope this helps
    Code:
    <script type="text/javascript">
    
    
    function getDaysPassed(){
    	var curDate=new Date;
    	var daysInMonth=Array(31,curDate.getFullYear()%4 ? 29 : 28, 31, 30,31,30,31,31,30,31,30,31);
    	var curDay=curDate.getDate();
    	var daysPassed=0;
    
    	for(i=0;i<curDate.getMonth()-1;i++){
    		daysPassed+=daysInMonth[i];
    	}
    	daysPassed+=curDay;
    	return daysPassed;
    }
    
    alert(getDaysPassed())
    
    </script>
    Bittersweet web development.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles