I have this code but it does not work
javascript Code:
<script language="javascript"> function script(){ var today = new Date(); var weekno = today.getWeek(); alert(weekno); } </script> </head> <body onload="script();"> </body>
I have this code but it does not work
javascript Code:
<script language="javascript"> function script(){ var today = new Date(); var weekno = today.getWeek(); alert(weekno); } </script> </head> <body onload="script();"> </body>
If you want number of week in month you have to create it on different way because its not defined inside javascript by default.
javascript Code:
<script type="text/javascript"> var Date = new Date(); var day = Date.getDate(); if(day<=7) { alert("Its first week of month."); } else if(day<=14) { alert("Its second week of month."); } else if(day<=21) { alert("Its third week of the month."); } else if(day<=28) { alert("Its fourth week of the month."); } </script>
I want the week number of the year, ie: week 23
Datejs has methods for getWeek() and getISOWeek(), which is what I think you're looking for.
Don't forget about rep points if you think a post has benefited you in any way.
Just another Perl hacker,