Allows the date + time picker to specify a format in the pre-values.

This commit is contained in:
Shannon
2015-06-18 10:14:31 +02:00
parent c962a9331a
commit f4d507eaa0
4 changed files with 17 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
internal class DatePreValueEditor : PreValueEditor
{
[PreValueField("format", "Date format", "textstring", Description = "If left empty then the format is YYYY-MM-DD. (see momentjs.com for supported formats)")]
public string DefaultValue { get; set; }
}
}

View File

@@ -62,11 +62,5 @@ namespace Umbraco.Web.PropertyEditors
{
return new DatePreValueEditor();
}
internal class DatePreValueEditor : PreValueEditor
{
[PreValueField("format", "Date format", "textstring", Description = "If left empty then the format is YYYY-MM-DD. (see momentjs.com for supported formats)")]
public string DefaultValue { get; set; }
}
}
}

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Web.PropertyEditors
private IDictionary<string, object> _defaultPreVals;
/// <summary>
/// Overridden because we ONLY support Date + Time format and we don't have pre-values in the db.
/// Overridden because we ONLY support Date + Time format
/// </summary>
public override IDictionary<string, object> DefaultPreValues
{
@@ -37,5 +37,10 @@ namespace Umbraco.Web.PropertyEditors
return editor;
}
protected override PreValueEditor CreatePreValueEditor()
{
return new DatePreValueEditor();
}
}
}

View File

@@ -298,6 +298,7 @@
<Compile Include="ApplicationContextExtensions.cs" />
<Compile Include="AreaRegistrationContextExtensions.cs" />
<Compile Include="HtmlHelperBackOfficeExtensions.cs" />
<Compile Include="PropertyEditors\DatePreValueEditor.cs" />
<Compile Include="UmbracoDefaultOwinStartup.cs" />
<Compile Include="IUmbracoContextAccessor.cs" />
<Compile Include="Models\ContentEditing\Relation.cs" />