File tree 2 files changed +13
-6
lines changed
Umbraco.Core/Models/Rdbms
umbraco.editorControls/datepicker 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -65,12 +65,12 @@ public object GetValue
65
65
return Date . Value ;
66
66
}
67
67
68
- if ( ! string . IsNullOrEmpty ( VarChar ) )
68
+ if ( string . IsNullOrEmpty ( VarChar ) == false )
69
69
{
70
70
return VarChar ;
71
71
}
72
72
73
- if ( ! string . IsNullOrEmpty ( Text ) )
73
+ if ( string . IsNullOrEmpty ( Text ) == false )
74
74
{
75
75
return Text ;
76
76
}
Original file line number Diff line number Diff line change @@ -11,10 +11,17 @@ public DateData(cms.businesslogic.datatype.BaseDataType DataType) : base(DataTyp
11
11
12
12
public override System . Xml . XmlNode ToXMl ( System . Xml . XmlDocument d )
13
13
{
14
- if ( Value != null && Value . ToString ( ) != "" )
15
- return d . CreateTextNode ( ( ( DateTime ) Value ) . ToString ( "s" ) ) ;
16
- else
17
- return d . CreateTextNode ( "" ) ;
14
+ if ( Value != null && Value . ToString ( ) != "" )
15
+ {
16
+ if ( Value is DateTime )
17
+ return d . CreateTextNode ( ( ( DateTime ) Value ) . ToString ( "s" ) ) ;
18
+
19
+ DateTime convertedDate ;
20
+ if ( DateTime . TryParse ( Value . ToString ( ) , out convertedDate ) )
21
+ return d . CreateTextNode ( convertedDate . ToString ( "s" ) ) ;
22
+ }
23
+
24
+ return d . CreateTextNode ( "" ) ;
18
25
}
19
26
20
27
public override void MakeNew ( int PropertyId )
You can’t perform that action at this time.
0 commit comments