Created
June 18, 2016 13:14
-
-
Save l02162010/6e71e45e0ec3b3ed7e8ac70536a26ccc 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><%= title %></title> | |
<link rel='stylesheet' href='/stylesheets/style.css' /> | |
<link rel="stylesheet" href="/bootstrap/dist/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="/components-font-awesome/css/font-awesome.min.css"> | |
<script src="/jquery/dist/jquery.min.js"></script> | |
<script src="/bootstrap/dist/js/bootstrap.min.js"></script> | |
</head> | |
<body> | |
<h1><%= title %></h1> | |
<p>Welcome to <%= title %></p> | |
<p id="year">year</p> | |
<p id="month">month</p> | |
<p id="date">date</p> | |
<p id="day">day</p> | |
<p id="datelast"></p> | |
<table id="count"></table> | |
<div class="fa fa-spinner fa-pulse fa-3x fa-fw"></div> | |
<span class="sr-only"></span> | |
</body> | |
<script> | |
$(document).ready(function () { | |
var time = new Date(); | |
var timeA = new Date(); | |
time.setMonth(time.getMonth()+1); | |
var year = time.getFullYear(); | |
var month = time.getMonth(); | |
timeA.setMonth(month+2); | |
var date = time.getDate(); | |
var day = time.getDay(); | |
timeA.setDate(-1); | |
var datelast = timeA.getDate(); | |
var i = 1; | |
var text = ""; | |
while (i < datelast+1) { | |
if (i%7 == 0){ | |
text += '<td>'+"第" + i +"日"+'</td>'; | |
}else { | |
text += '<td>'+"第" + i +"天"+'</td>'; | |
} | |
i++ | |
} | |
$('#count').append(text) | |
$('#year').text(year + "年"); | |
$('#month').text(month + "月"); | |
$('#date').text(date + "日"); | |
$('#monthlast').text() | |
$('#datelast').text(datelast+"是這月最後一天"); | |
$('#day').text("星期" + day); | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment