fix(module: datepicker): incorrect week comparison causes disabled input (#2889)

This commit is contained in:
Alex Kryvdyk 2022-11-20 16:56:52 +02:00 committed by GitHub
parent 18ff8e3dee
commit b83175b3f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using AntDesign.Core.Extensions;
@ -106,7 +106,8 @@ namespace AntDesign
{
var date1Week = DateHelper.GetWeekOfYear(date1, Locale.FirstDayOfWeek);
var date2Week = DateHelper.GetWeekOfYear(date2, Locale.FirstDayOfWeek);
return index == 0 ? date1Week < date2Week : date1Week > date2Week;
return index == 0 ? date1Week < date2Week && date1.Year <= date2.Year
: date1.Year >= date2.Year && date1Week > date2Week;
}
else
{