Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions src/Core/Components/DateTime/FluentCalendar.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ private async Task PickerYearSelectAsync(DateTime? year)
/// <summary />
protected override bool TryParseValueFromString(string? value, out DateTime? result, [NotNullWhen(false)] out string? validationErrorMessage)
{
BindConverter.TryConvertTo(value, Culture, out result);
validationErrorMessage = null;
return true;
bool success = BindConverter.TryConvertTo(value, Culture, out result);
validationErrorMessage = success? null : $"The {DisplayName ?? (FieldBound ? FieldIdentifier.FieldName : UnknownBoundField)} field is not in a valid format.";
return success;
}

/// <summary />
Expand Down
7 changes: 3 additions & 4 deletions src/Core/Components/DateTime/FluentDatePicker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ protected override bool TryParseValueFromString(string? value, out DateTime? res
value = new DateTime(year, 1, 1).ToString(Culture.DateTimeFormat.ShortDatePattern);
}

BindConverter.TryConvertTo(value, Culture, out result);

validationErrorMessage = null;
return true;
bool success = BindConverter.TryConvertTo(value, Culture, out result);
validationErrorMessage = success ? null : $"The {DisplayName ?? (FieldBound ? FieldIdentifier.FieldName : UnknownBoundField)} field is not in a valid format.";
return success;
}

private string PlaceholderAccordingToView()
Expand Down
Loading