/
DateEditorAttribute.cs
57 lines (52 loc) · 1.45 KB
/
DateEditorAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace Serenity.ComponentModel;
/// <summary>
/// Indicates that the target property should use a "Date" editor.
/// </summary>
/// <seealso cref="CustomEditorAttribute" />
public class DateEditorAttribute : CustomEditorAttribute
{
/// <summary>
/// Editor type key
/// </summary>
public const string Key = "Date";
/// <summary>
/// Initializes a new instance of the <see cref="DateEditorAttribute"/> class.
/// </summary>
public DateEditorAttribute()
: base(Key)
{
}
/// <summary>
/// Gets or sets the minimum value.
/// </summary>
/// <value>
/// The minimum value.
/// </value>
public DateTime MinValue
{
get { return GetOption<DateTime>("minValue"); }
set { SetOption("minValue", value); }
}
/// <summary>
/// Gets or sets the maximum value.
/// </summary>
/// <value>
/// The maximum value.
/// </value>
public DateTime MaxValue
{
get { return GetOption<DateTime>("maxValue"); }
set { SetOption("maxValue", value); }
}
/// <summary>
/// Gets or sets a value indicating whether SQL server min max dates should be used.
/// </summary>
/// <value>
/// <c>true</c> if SQL server min max dates should be used; otherwise, <c>false</c>.
/// </value>
public bool SqlMinMax
{
get { return GetOption<bool?>("sqlMinMax") ?? true; }
set { SetOption("sqlMinMax", value); }
}
}