我想为图表的每一行显示实时倒计时时钟。 和@ solicitation.SolicitationResponseDeadLine是每一行的到期时间。 我可以显示倒计时,但仅显示第一行(重复ID)。请帮我。谢谢
<tbody>
@foreach (var solicitation in Model)
{
<tr>
<td scope="row">
<a href="@string.Format(ConfigurationManager.AppSettings["FBOListingLink"], (string) ViewBag.CallingIC, solicitation.SolicitationNumber)" target="_blank">
@solicitation.SolicitationNumber
</a>
</td>
<td>
@solicitation.GetNoticeTypeName()
</td>
<td>
@solicitation.SolicitationTitle
</td>
<td style="width: 15%;">
@*@solicitation.eCPSUser_UserType.AppUser.AppUserFullName*@
@solicitation.PrimaryAssociation.appUser.AppUserFullName
</td>
<td align="center" style="width: 15%;">
@solicitation.SolicitationResponseDeadline
</td>
<td>
<span style="display: block;">@solicitation.SolicitationResponseDeadline</span>
<span class="#countDownCell"></span>
</td>
</tr>
}
答案 0 :(得分:-1)
@{
var vYear = Convert.ToDateTime(solicitation.SolicitationResponseDeadline).Year;
var vMonth = Convert.ToDateTime(solicitation.SolicitationResponseDeadline).Month;
var vDay = Convert.ToDateTime(solicitation.SolicitationResponseDeadline).Day;
var vMinute = Convert.ToDateTime(solicitation.SolicitationResponseDeadline).Minute;
var vSecond = Convert.ToDateTime(solicitation.SolicitationResponseDeadline).Second;
}
<script type="text/javascript">
var note = "the winter is coming";
var nYear = [@vYear];
var nMonth = [@vMonth];
var nDay = [@vDay];
var nMinute = [@vMinute];
var nSecond = [@vSecond];
tdy = new Date(nYear, nMonth, nDay, nMinute, nSecond);
$("#testCountDown").countdown({
until: tdy,
compact: true,
description: ""
});