mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 15:43:08 +00:00
Correctly check if inCinemas date is present. Creates issue with sorting, but eh. Fixes 140.
This commit is contained in:
parent
95bd615718
commit
2cbe17151d
2 changed files with 18 additions and 9 deletions
|
@ -7,10 +7,16 @@ module.exports = TemplatedCell.extend({
|
|||
var monthNames = ["January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
];
|
||||
var cinemasDate = new Date(this.model.get("inCinemas"));
|
||||
var year = cinemasDate.getFullYear();
|
||||
var month = monthNames[cinemasDate.getMonth()];
|
||||
this.$el.html(month + " " + year); //Hack, but somehow handlebar helper does not work.
|
||||
return this;
|
||||
|
||||
this.$el.html("To be announced");
|
||||
|
||||
if (this.model.get("inCinemas")) {
|
||||
var cinemasDate = new Date(this.model.get("inCinemas"));
|
||||
var year = cinemasDate.getFullYear();
|
||||
var month = monthNames[cinemasDate.getMonth()];
|
||||
this.$el.html(month + " " + year); //Hack, but somehow handlebar helper does not work.
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -181,10 +181,13 @@ Handlebars.registerHelper('inCinemas', function() {
|
|||
var year = d.getFullYear();
|
||||
return "Available: " + day + ". " + month + " " + year;
|
||||
}
|
||||
var cinemasDate = new Date(this.inCinemas);
|
||||
var year = cinemasDate.getFullYear();
|
||||
var month = monthNames[cinemasDate.getMonth()];
|
||||
return "In Cinemas: " + month + " " + year;
|
||||
if (this.inCinemas) {
|
||||
var cinemasDate = new Date(this.inCinemas);
|
||||
var year = cinemasDate.getFullYear();
|
||||
var month = monthNames[cinemasDate.getMonth()];
|
||||
return "In Cinemas: " + month + " " + year;
|
||||
}
|
||||
return "To be announced";
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('tvRageUrl', function() {
|
||||
|
|
Loading…
Reference in a new issue