Dates used for sorting will rely on EN-US standard, display will relay on user's culture.

pull/19/head
Mark McDowall 13 years ago
parent 02ecd0f958
commit baed29710e

@ -37,6 +37,7 @@ namespace NzbDrone.Web.Controllers
Quality = h.Quality.ToString(), Quality = h.Quality.ToString(),
IsProper = h.IsProper, IsProper = h.IsProper,
Date = h.Date.ToString(), Date = h.Date.ToString(),
DateSorter = h.Date.ToString("MM/dd/yyyy h:mm:ss tt"),
Indexer = h.Indexer, Indexer = h.Indexer,
EpisodeId = h.EpisodeId EpisodeId = h.EpisodeId
}).OrderByDescending(h => h.Date).ToList(); }).OrderByDescending(h => h.Date).ToList();

@ -31,7 +31,7 @@ namespace NzbDrone.Web.Controllers
EpisodeTitle = e.Title, EpisodeTitle = e.Title,
Overview = e.Overview, Overview = e.Overview,
SeriesTitle = e.Series.Title, SeriesTitle = e.Series.Title,
AirDate = e.AirDate.Value.ToString(), AirDate = e.AirDate.Value.ToString("MM/dd/yyyy"),
AirDateString = e.AirDate.Value.ToBestDateString() AirDateString = e.AirDate.Value.ToBestDateString()
}); });

@ -46,7 +46,7 @@ namespace NzbDrone.Web.Controllers
Overview = u.Overview, Overview = u.Overview,
AirDateTime = GetDateTime(u.AirDate.Value, u.Series.AirTimes), AirDateTime = GetDateTime(u.AirDate.Value, u.Series.AirTimes),
AirDate = u.AirDate.Value.ToBestDateString(), AirDate = u.AirDate.Value.ToBestDateString(),
AirTime = String.IsNullOrEmpty(u.Series.AirTimes) ? "?" : Convert.ToDateTime(u.Series.AirTimes).ToShortTimeString(), AirTime = String.IsNullOrEmpty(u.Series.AirTimes) ? "?" : Convert.ToDateTime(u.Series.AirTimes).ToString("MM/dd/yyyy"),
Status = u.Status.ToString() Status = u.Status.ToString()
}).OrderBy(e => e.AirDateTime).ToList(); }).OrderBy(e => e.AirDateTime).ToList();
} }

@ -14,6 +14,7 @@ namespace NzbDrone.Web.Models
public string NzbTitle { get; set; } public string NzbTitle { get; set; }
public string Quality { get; set; } public string Quality { get; set; }
public string Date { get; set; } public string Date { get; set; }
public string DateSorter { get; set; }
public bool IsProper { get; set; } public bool IsProper { get; set; }
public string Indexer { get; set; } public string Indexer { get; set; }
public int EpisodeId { get; set; } public int EpisodeId { get; set; }

@ -73,6 +73,15 @@
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title { sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
{ sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality { sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality
{ sWidth: '150px', "mDataProp": "Date" }, //Grabbed On { sWidth: '150px', "mDataProp": "Date" }, //Grabbed On
{ sWidth: '150px', "mDataProp": function (source, type, val) {
// 'display' and 'filter' use our fancy naming
if (type === 'display' || type === 'filter') {
return source["Date"];
}
// 'sort' and 'type' both just use the raw data
return source["DateSorter"];
}
}, //Date
{ sWidth: '40px', "mDataProp": "HistoryId", "bSortable": false, "fnRender": function (row) { { sWidth: '40px', "mDataProp": "HistoryId", "bSortable": false, "fnRender": function (row) {
var deleteImage = "<img src=\"../../Content/Images/X.png\" alt=\"Delete\" title=\"Delete from History\" class=\"gridImage\" onclick=\"deleteHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ")\">"; var deleteImage = "<img src=\"../../Content/Images/X.png\" alt=\"Delete\" title=\"Delete from History\" class=\"gridImage\" onclick=\"deleteHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ")\">";
var redownloadImage = "<img src=\"../../Content/Images/Downloading.png\" alt=\"Redownload\" title=\Redownload Episode\" class=\"gridImage\" onclick=\"redownloadHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ", " + row.aData["EpisodeId"] + ")\">"; var redownloadImage = "<img src=\"../../Content/Images/Downloading.png\" alt=\"Redownload\" title=\Redownload Episode\" class=\"gridImage\" onclick=\"redownloadHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ", " + row.aData["EpisodeId"] + ")\">";

Loading…
Cancel
Save