fix: use Gregorian week number for API and Persian for display
All checks were successful
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 2m18s
All checks were successful
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 2m18s
This commit is contained in:
@@ -88,14 +88,13 @@ public class GetAvailableWeeksQueryHandler : IRequestHandler<GetAvailableWeeksQu
|
||||
|
||||
var isCalculated = pool != null && pool.IsCalculated;
|
||||
|
||||
// تبدیل weekNumber به شمسی
|
||||
var persianWeekNumber = ConvertWeekNumberToPersian(weekNumber, startDate);
|
||||
|
||||
// تبدیل تاریخ به شمسی برای نمایش
|
||||
var persianCalendar = new PersianCalendar();
|
||||
var startDatePersian = $"{persianCalendar.GetYear(startDate):D4}/{persianCalendar.GetMonth(startDate):D2}/{persianCalendar.GetDayOfMonth(startDate):D2}";
|
||||
var endDatePersian = $"{persianCalendar.GetYear(endDate):D4}/{persianCalendar.GetMonth(endDate):D2}/{persianCalendar.GetDayOfMonth(endDate):D2}";
|
||||
|
||||
// تبدیل weekNumber به شمسی فقط برای نمایش
|
||||
var persianWeekNumber = ConvertWeekNumberToPersian(weekNumber, startDate);
|
||||
var displayText = $"{persianWeekNumber} ({startDatePersian} - {endDatePersian})";
|
||||
|
||||
if (isCalculated)
|
||||
@@ -105,7 +104,7 @@ public class GetAvailableWeeksQueryHandler : IRequestHandler<GetAvailableWeeksQu
|
||||
|
||||
return new WeekInfoDto
|
||||
{
|
||||
WeekNumber = persianWeekNumber, // شمسی
|
||||
WeekNumber = weekNumber, // میلادی (برای API)
|
||||
StartDate = startDate,
|
||||
EndDate = endDate,
|
||||
IsCalculated = isCalculated,
|
||||
@@ -113,7 +112,7 @@ public class GetAvailableWeeksQueryHandler : IRequestHandler<GetAvailableWeeksQu
|
||||
LastExecutionStatus = log?.Status.ToString(),
|
||||
TotalPoolAmount = pool?.TotalPoolAmount,
|
||||
EligibleUsersCount = pool?.UserCommissionPayouts?.Count ?? 0,
|
||||
DisplayText = displayText
|
||||
DisplayText = displayText // شمسی (برای نمایش)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user