JavaScript
- 2 ответа
- 0 вопросов
1
Вклад в тег
@if (th.FMessage.Count > 0)
{
var message = th.FMessage.OrderByDescending(m => m.ForumMessageId).FirstOrDefault();
@message.MessageDate
<text>От</text> @message.User.DisplayName
}
<iframe src="http://docs.google.com/gview?url={url_doc}&embedded=true"></iframe>
var from= new Date(2013, 5, 12);
var to= new Date(2016, 2, 25);
getRange(from, to);
function getRange(dateFrom, dateTo) {
var dayRange = (dateTo - dateFrom)/(1000 * 60 * 60 * 24);
var result = {};
for(var i = 0; i < dayRange; i++) {
if (typeof result[dateFrom.getFullYear()] == "undefined")
result[dateFrom.getFullYear()] = {};
if (typeof result[dateFrom.getFullYear()][dateFrom.getMonth()+1] == "undefined")
result[dateFrom.getFullYear()][dateFrom.getMonth()+1] = [];
result[dateFrom.getFullYear()][dateFrom.getMonth()+1].push(dateFrom.getDate());
dateFrom.setDate(dateFrom.getDate() + 1);
}
return result;
}