增加作业倒计时显示
This commit is contained in:
parent
2de2355e5c
commit
d0e549fc85
|
@ -1,4 +1,23 @@
|
||||||
<!--modified by huang-->
|
<!--modified by huang-->
|
||||||
|
<script type="text/javascript">
|
||||||
|
function ShowCountDown(year,month,day,divname)
|
||||||
|
{
|
||||||
|
var now = new Date();
|
||||||
|
var endDate = new Date(year, month-1, day);
|
||||||
|
var leftTime=endDate.getTime()-now.getTime();
|
||||||
|
var leftsecond = parseInt(leftTime/1000);
|
||||||
|
var day1=Math.floor(leftsecond/(60*60*24));
|
||||||
|
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
|
||||||
|
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
|
||||||
|
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
|
||||||
|
$("#"+divname).html("<span style='color: #acaeb1;'>作业提交还剩 :</span> <span style='color: red;'>"
|
||||||
|
+day1+" </span><span style='color: #acaeb1;'>天</span><span style='color: red;'> "
|
||||||
|
+hour+" </span><span style='color: #acaeb1;'>时</span><span style='color: red;'> "
|
||||||
|
+minute+" </span><span style='color: #acaeb1;'>分</span><span style='color: red;'> "
|
||||||
|
+second+" </span><span style='color: #acaeb1;'>秒</span>");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<% if bids.blank? %>
|
<% if bids.blank? %>
|
||||||
<%#= l(:label_uncommit_homework) %>
|
<%#= l(:label_uncommit_homework) %>
|
||||||
暂无作业!
|
暂无作业!
|
||||||
|
@ -100,12 +119,12 @@
|
||||||
<%= l(:label_commit_limit)%>
|
<%= l(:label_commit_limit)%>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if betweentime(bid.deadline) < 3 %>
|
<script type="text/javascript">
|
||||||
<span style="color: red">
|
window.setInterval(function(){ShowCountDown(<%= bid.deadline.year%>,<%= bid.deadline.month%>,<%= bid.deadline.day + 1%>,"show_deadtime_span_<%= bid.id%>");},1000)
|
||||||
<%= l(:label_commit_ar) %>
|
</script>
|
||||||
|
<span id="show_deadtime_span_<%= bid.id%>" style="float: right">
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue