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
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Messaging.Events;
@@ -254,6 +255,48 @@ namespace NzbDrone.Core.Configuration
set { SetValue("ChownGroup", value); }
}
public Int32 FirstDayOfWeek
{
get { return GetValueInt("FirstDayOfWeek", (int)OsInfo.FirstDayOfWeek); }
set { SetValue("FirstDayOfWeek", value); }
}
public String CalendarWeekColumnHeader
{
get { return GetValue("CalendarWeekColumnHeader", "ddd M/D"); }
set { SetValue("CalendarWeekColumnHeader", value); }
}
public String ShortDateFormat
{
get { return GetValue("ShortDateFormat", "MMM D YYYY"); }
set { SetValue("ShortDateFormat", value); }
}
public String LongDateFormat
{
get { return GetValue("LongDateFormat", "dddd, MMMM D YYYY"); }
set { SetValue("LongDateFormat", value); }
}
public String TimeFormat
{
get { return GetValue("TimeFormat", "h(:mm)a"); }
set { SetValue("TimeFormat", value); }
}
public Boolean ShowRelativeDates
{
get { return GetValueBoolean("ShowRelativeDates", true); }
set { SetValue("ShowRelativeDates", value); }
}
private string GetValue(string key)
{
return GetValue(key, String.Empty);
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Update;
namespace NzbDrone.Core.Configuration
{
@@ -49,5 +48,14 @@ namespace NzbDrone.Core.Configuration
Int32 Retention { get; set; }
Int32 RssSyncInterval { get; set; }
String ReleaseRestrictions { get; set; }
//UI
Int32 FirstDayOfWeek { get; set; }
String CalendarWeekColumnHeader { get; set; }
String ShortDateFormat { get; set; }
String LongDateFormat { get; set; }
String TimeFormat { get; set; }
Boolean ShowRelativeDates { get; set; }
}
}