Calendar/Date localization

New: Choose calendar starting day of week
New: Choose prefered date/time formats
New: Option to disable relative dates and show absolute dates instead
This commit is contained in:
Mark McDowall
2014-08-04 22:44:09 -07:00
parent 0ba19f0cd7
commit 18874e2c79
32 changed files with 4049 additions and 1808 deletions
+5 -5
View File
@@ -26,7 +26,7 @@ define(
EpisodeNumberCell,
EpisodeWarningCell,
CommandController,
Moment,
moment,
_,
Messenger) {
return Marionette.Layout.extend({
@@ -213,15 +213,15 @@ define(
},
_shouldShowEpisodes: function () {
var startDate = Moment().add('month', -1);
var endDate = Moment().add('year', 1);
var startDate = moment().add('month', -1);
var endDate = moment().add('year', 1);
return this.episodeCollection.some(function (episode) {
var airDate = episode.get('airDateUtc');
if (airDate) {
var airDateMoment = Moment(airDate);
var airDateMoment = moment(airDate);
if (airDateMoment.isAfter(startDate) && airDateMoment.isBefore(endDate)) {
return true;
@@ -235,7 +235,7 @@ define(
templateHelpers: function () {
var episodeCount = this.episodeCollection.filter(function (episode) {
return episode.get('hasFile') || (episode.get('monitored') && Moment(episode.get('airDateUtc')).isBefore(Moment()));
return episode.get('hasFile') || (episode.get('monitored') && moment(episode.get('airDateUtc')).isBefore(moment()));
}).length;
var episodeFileCount = this.episodeCollection.where({ hasFile: true }).length;
@@ -37,7 +37,7 @@
<div class="col-md-10 col-xs-8">
{{#if_eq status compare="continuing"}}
{{#if nextAiring}}
<span class="label label-default">{{NextAiring nextAiring}}</span>
<span class="label label-default">{{RelativeDate nextAiring}}</span>
{{/if}}
{{else}}
<span class="label label-danger">Ended</span>
@@ -22,7 +22,7 @@
<div class="labels">
{{#if_eq status compare="continuing"}}
{{#if nextAiring}}
<span class="label label-default">{{NextAiring nextAiring}}</span>
<span class="label label-default">{{RelativeDate nextAiring}}</span>
{{/if}}
{{/if_eq}}
{{> EpisodeProgressPartial }}
+3 -3
View File
@@ -65,9 +65,9 @@ define(
cell : 'integer'
},
{
name : 'profileId',
label: 'Profile',
cell : ProfileCell
name : 'profileId',
label : 'Profile',
cell : ProfileCell
},
{
name : 'network',
+3 -3
View File
@@ -10,7 +10,7 @@ define(
'Mixins/AsSortedCollection',
'Mixins/AsPersistedStateCollection',
'moment'
], function (_, Backbone, PageableCollection, SeriesModel, SeriesData, AsFilteredCollection, AsSortedCollection, AsPersistedStateCollection, Moment) {
], function (_, Backbone, PageableCollection, SeriesModel, SeriesData, AsFilteredCollection, AsSortedCollection, AsPersistedStateCollection, moment) {
var Collection = PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/series',
model: SeriesModel,
@@ -63,13 +63,13 @@ define(
var nextAiring = model.get(attr);
if (nextAiring) {
return Moment(nextAiring).unix();
return moment(nextAiring).unix();
}
var previousAiring = model.get(attr.replace('nextAiring', 'previousAiring'));
if (previousAiring) {
return 10000000000 - Moment(previousAiring).unix();
return 10000000000 - moment(previousAiring).unix();
}
return Number.MAX_VALUE;