The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
JavaScript
I am trying to modify:
Code:
<script type="text/javascript">d = new Date();y = d.getFullYear();document.write(y);</script> I'm pretty sure the variables I need are: today.getMonth () and today.getDate() I just can't seem to get the syntax correct... |
#2
|
|||
|
|||
You don't need <script type="text/javascript">, <script> is ok.
Code:
<script> var d = new Date(); const options = { year: 'numeric', month: 'long', day: 'numeric' }; document.write(d.toLocaleDateString('en-US', options)); </script> Code:
<p id="datedemo"></p> <script> var d = new Date(); const options = { year: 'numeric', month: 'long', day: 'numeric' }; document.getElementById("datedemo").innerHTML = d.toLocaleDateString('en-US', options); </script> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|