Created
May 17, 2012 03:12
-
-
Save tomo3141592653/2715939 to your computer and use it in GitHub Desktop.
今日がクリスマスの何なのか分かるページ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="chiristmas" style="font-size: xx-large;"> </p> | |
<script type="text/javascript">// <![CDATA[ | |
var now =new Date(); | |
var new_year = new Date("Dec 25, 2012 0:0:0"); | |
var num_of_yoi = 1+( new_year.getTime() - now.getTime())/ 86400000; | |
field= document.getElementById('chiristmas'); | |
var yois = ""; | |
for (i=0;i<num_of_yoi;i++) | |
{ | |
yois += "イブ"; | |
} | |
if(num_of_yoi > 0){ | |
field.innerHTML=("今夜はクリスマス"+yois+ "です。") | |
} | |
else{ | |
field.innerHTML=("2012年クリスマスは終わりました。") | |
} | |
// ]]></script> | |
<p>注意:本当はイブに「前日の」という意味はありません。</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment