Allows the date + time picker to specify a format in the pre-values.
This commit is contained in:
10
src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs
Normal file
10
src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user