mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
fix(module: range-picker): placeholder and value equals null (#1088)
Co-authored-by: James Yeung <shunjiey@hotmail.com>
This commit is contained in:
parent
ea061850ec
commit
a592fa4dd0
@ -101,6 +101,11 @@ namespace AntDesign
|
||||
RangePickerDefaults.ProcessDefaults(Value, DefaultValue, DefaultPickerValue, PickerValues, UseDefaultPickerValue);
|
||||
_pickerValuesAfterInit[0] = PickerValues[0];
|
||||
_pickerValuesAfterInit[1] = PickerValues[1];
|
||||
if (_value == null)
|
||||
{
|
||||
_value = CreateInstance();
|
||||
ValueChanged.InvokeAsync(_value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -205,6 +210,10 @@ namespace AntDesign
|
||||
array.SetValue(default, 0);
|
||||
array.SetValue(default, 1);
|
||||
|
||||
(string first, string second) = DatePickerPlaceholder.GetRangePlaceHolderByType(_pickerStatus[0]._initPicker, Locale);
|
||||
_placeholders[0] = first;
|
||||
_placeholders[1] = second;
|
||||
|
||||
_pickerStatus[0]._hadSelectValue = false;
|
||||
_pickerStatus[1]._hadSelectValue = false;
|
||||
|
||||
|
@ -609,18 +609,17 @@ namespace AntDesign
|
||||
if (IsNullable)
|
||||
{
|
||||
var tempValue = value as DateTime?[];
|
||||
if (tempValue[0] == null || tempValue[1] == null)
|
||||
return orderedValue;
|
||||
|
||||
if ((tempValue[0] ?? DateTime.Now).CompareTo((tempValue[1] ?? DateTime.Now)) > 0)
|
||||
{
|
||||
orderedValue = DataConvertionExtensions.Convert<DateTime?[], TValue>(new DateTime?[] { tempValue[1], tempValue[0] });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var tempValue = value as DateTime[];
|
||||
if (tempValue[0].CompareTo(tempValue[1]) > 0)
|
||||
{
|
||||
orderedValue = DataConvertionExtensions.Convert<DateTime[], TValue>(new DateTime[] { tempValue[1], tempValue[0] });
|
||||
}
|
||||
}
|
||||
}
|
||||
return orderedValue;
|
||||
|
Loading…
Reference in New Issue
Block a user