Can you add the current date into a menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Can you add the current date into a menu?

Post by wuscheck »

I got it... learning by doing ;)
wpatters1229
Super Advanced
Super Advanced
Posts: 90
Joined: Thu May 30, 2002 7:35 pm

Re: Can you add the current date into a menu?

Post by wpatters1229 »

I am not that good at scripts and am wondering if you can change the order of the date?
Right now is says Sat 1st May 2010....would like it to say just May 1, 2010

Is there a way to tweak the code to do that?

Thanks
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Can you add the current date into a menu?

Post by wuscheck »

Change the menuclock.js like this... it's untested:

Code: Select all

+ monthNames[_month]+_day+","+ _year
The array for the monthNames:

Code: Select all

monthNames=new Array("January", "February", "March",.....
wpatters1229
Super Advanced
Super Advanced
Posts: 90
Joined: Thu May 30, 2002 7:35 pm

Re: Can you add the current date into a menu?

Post by wpatters1229 »

Thanks for the help...I actually played with the code and figured out how to do it along with using the piece that adds the "st" or the "rd" etc. depending on the numeric day. So not it shows "May 1st 2010" or as for today "May 3rd 2010"

Coding always frustrates me since I always forget the syntax and if you miss one little semi-colon or comma it all goes away...
Was never that good with written languages either....memory thing or just not that kind of a brain. I am much better at solving problems and engineering.
Post Reply