Hi Guys, just signed up and hope someone may be able to help. Have a "Tomorrow" button on my website which pulls data from MySQL, this then displays a list of jobs loaded for the following day - works fine except on month ends.
I should say that the site was built for me as I do not have a great understanding of Javascript etc but digging through the code currently being used is this :
Todays date is pulled from the server I guess then the "var theday=mydate.g etDate()+1" part is being used to add a day on. Clearly though this does not account for month ends, clicking the "tomorrow" button today the 31st Jan and the results try to display results for 32nd Jan rather than 1st Feb!!
Sorry this is probably quite basic, I am hopeful I can just add a bit more code to account for the 12 dates per year that it causes an issue. Be grateful for any advice.
Thanks
Sinclair
I should say that the site was built for me as I do not have a great understanding of Javascript etc but digging through the code currently being used is this :
Code:
var mydate=new Date() var theyear=mydate.getYear() if (theyear < 1000) theyear+=1900 var theday=mydate.getDay() var themonth=mydate.getMonth()+1 if (themonth<10) themonth="0"+themonth var theday=mydate.getDate()+1 if (theday<10) theday="0"+theday var displayfirst=theyear var displaysecond=themonth var displaythird=theday document.RequestForm.DOTS5.value=displayfirst+"-"+displaysecond+"-"+displaythird document.RequestForm.DOTF5.value=displayfirst+"-"+displaysecond+"-"+displaythird
Todays date is pulled from the server I guess then the "var theday=mydate.g etDate()+1" part is being used to add a day on. Clearly though this does not account for month ends, clicking the "tomorrow" button today the 31st Jan and the results try to display results for 32nd Jan rather than 1st Feb!!
Sorry this is probably quite basic, I am hopeful I can just add a bit more code to account for the 12 dates per year that it causes an issue. Be grateful for any advice.
Thanks
Sinclair
Comment