diff --git a/Website/Web.config b/Website/Web.config
index b649c397..1ebe30f4 100644
--- a/Website/Web.config
+++ b/Website/Web.config
@@ -1,180 +1,162 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
+
-
-
+
-
-
+
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
-
+
+
-
-
-
-
+
+
+
-
-
-
+
+
-
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/Website/app_code/code/Blog.cs b/Website/app_code/code/Blog.cs
index 9b171b22..84b3ae70 100644
--- a/Website/app_code/code/Blog.cs
+++ b/Website/app_code/code/Blog.cs
@@ -21,6 +21,10 @@ static Blog()
Image = ConfigurationManager.AppSettings.Get("blog:image");
ModerateComments = bool.Parse(ConfigurationManager.AppSettings.Get("blog:moderateComments"));
BlogPath = ConfigurationManager.AppSettings.Get("blog:path");
+
+ DateFormat = GetStringAppSetting("blog:dateFormat", "MMMM d. yyyy");
+ DateTimeFormat = GetStringAppSetting("blog:dateTimeFormat", "MMMM d. yyyy HH:mm");
+ DateTimeFormatTitle = GetStringAppSetting("blog:dateTimeFormatTitle", "yyyy-MM-ddTHH:mm");
}
public static string Title { get; private set; }
@@ -31,7 +35,18 @@ static Blog()
public static int DaysToComment { get; private set; }
public static bool ModerateComments { get; private set; }
public static string BlogPath { get; private set; }
+ public static string DateFormat { get; private set; }
+ public static string DateTimeFormat { get; private set; }
+ public static string DateTimeFormatTitle { get; private set; }
+
+ private static string GetStringAppSetting(string setting, string defaultValue){
+ var value = ConfigurationManager.AppSettings.Get(setting);
+ value = value == null ? defaultValue : value;
+
+ return value;
+ }
+
public static string CurrentSlug
{
get { return (HttpContext.Current.Request.QueryString["slug"] ?? string.Empty).Trim().ToLowerInvariant(); }
diff --git a/Website/themes/OffCanvas/Comment.cshtml b/Website/themes/OffCanvas/Comment.cshtml
index b2679d10..0339fba3 100644
--- a/Website/themes/OffCanvas/Comment.cshtml
+++ b/Website/themes/OffCanvas/Comment.cshtml
@@ -11,8 +11,8 @@
@helper Date()
{
- var title = Model.PubDate.ToString("yyyy-MM-ddTHH:mm");
- var display = Model.PubDate.ToString("MMMM d. yyyy HH:mm");
+ var title = Model.PubDate.ToString(Blog.DateTimeFormatTitle);
+ var display = Model.PubDate.ToString(Blog.DateTimeFormat);
}
@helper Author()
diff --git a/Website/themes/OffCanvas/Post.cshtml b/Website/themes/OffCanvas/Post.cshtml
index 6e81f402..4c069beb 100644
--- a/Website/themes/OffCanvas/Post.cshtml
+++ b/Website/themes/OffCanvas/Post.cshtml
@@ -14,7 +14,7 @@ else
@Model.Title