Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNN-8761: trigger change event when the value changes to empty. #1513

Merged
merged 1 commit into from
Jun 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ protected DateTime OldDateValue
{
//Try and cast the value to an DateTime
var dteString = OldValue as string;
dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture);
if (!string.IsNullOrEmpty(dteString))
{
dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture);
}
}
catch (Exception exc)
{
Expand Down Expand Up @@ -244,8 +247,16 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo
string postedValue = postCollection[postDataKey + "_control"];
if (!presentValue.Equals(postedValue))
{
Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture);
dataChanged = true;
if (string.IsNullOrEmpty(postedValue))
{
Value = Null.NullDate;
dataChanged = true;
}
else
{
Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture);
dataChanged = true;
}
}
LoadDateControls();
return dataChanged;
Expand Down