fix(module: rangepicker): [selected date on end picker]、[quarter panel's ranges] are incorrect (#1260)

* fix(model: rangepicker): quarter panel's ranges are not correct

* fix(module: rangepicker): selected date on end picker is incorrect
This commit is contained in:
笨木头 2021-03-23 11:08:07 +08:00 committed by GitHub
parent 65d949ca7c
commit e5225afb05
2 changed files with 9 additions and 12 deletions

View File

@ -176,7 +176,7 @@ namespace AntDesign
int? second = null)
{
return DateHelper.CombineNewDate(
GetIndexPickerValue(0),
PickerValue,
year,
month,
day,
@ -188,16 +188,12 @@ namespace AntDesign
protected void ChangePickerYearValue(int interval)
{
var currentValue = GetIndexPickerValue(0);
ChangePickerValue(DateHelper.AddYearsSafely(currentValue, interval), null);
ChangePickerValue(DateHelper.AddYearsSafely(PickerValue, interval), null);
}
protected void ChangePickerMonthValue(int interval)
{
var currentValue = GetIndexPickerValue(0);
ChangePickerValue(DateHelper.AddMonthsSafely(currentValue, interval), null);
ChangePickerValue(DateHelper.AddMonthsSafely(PickerValue, interval), null);
}
protected void Close()

View File

@ -134,7 +134,8 @@ namespace AntDesign.Internal
private bool IsDateInRange(DateTime currentColDate)
{
if (!IsRange || !Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month))
if (!IsRange ||
!Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month, DatePickerType.Quarter))
{
return false;
}
@ -209,7 +210,7 @@ namespace AntDesign.Internal
private string GetRangeHoverCls(DateTime currentColDate)
{
if (!IsRange || DatePicker.HoverDateTime == null
|| Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month) == false)
|| Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month, DatePickerType.Quarter) == false)
{
return "";
}
@ -291,7 +292,7 @@ namespace AntDesign.Internal
private string GetRangeStartCls(DateTime currentColDate)
{
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month) == false)
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month, DatePickerType.Quarter) == false)
{
return "";
}
@ -332,7 +333,7 @@ namespace AntDesign.Internal
private string GetRangeEndCls(DateTime currentColDate)
{
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month) == false)
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month, DatePickerType.Quarter) == false)
{
return "";
}
@ -374,7 +375,7 @@ namespace AntDesign.Internal
private string GetRangeEdgeCls(DateTime currentColDate)
{
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month) == false)
if (!IsRange || Picker.IsIn(DatePickerType.Date, DatePickerType.Year, DatePickerType.Month, DatePickerType.Quarter) == false)
{
return "";
}