mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Addind timezone exceptions
--HG-- branch : 1.x
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using Orchard.Logging;
|
||||||
|
|
||||||
namespace Orchard.Time {
|
namespace Orchard.Time {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -10,8 +11,12 @@ namespace Orchard.Time {
|
|||||||
|
|
||||||
public SiteTimeZoneSelector(IWorkContextAccessor workContextAccessor) {
|
public SiteTimeZoneSelector(IWorkContextAccessor workContextAccessor) {
|
||||||
_workContextAccessor = workContextAccessor;
|
_workContextAccessor = workContextAccessor;
|
||||||
|
|
||||||
|
Logger = NullLogger.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) {
|
public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -25,9 +30,10 @@ namespace Orchard.Time {
|
|||||||
Priority = -5,
|
Priority = -5,
|
||||||
TimeZone = TimeZoneInfo.FindSystemTimeZoneById(siteTimeZoneId)
|
TimeZone = TimeZoneInfo.FindSystemTimeZoneById(siteTimeZoneId)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
catch {
|
catch(Exception e) {
|
||||||
|
Logger.Error(e, "TimeZone could not be loaded");
|
||||||
|
|
||||||
// if the database could not be updated in time, ignore this provider
|
// if the database could not be updated in time, ignore this provider
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user