Event description
In my code, the following judgment is implemented.
In recent years, it has been able to return successfully. However, in the recent implementation process, there have been misjudgments.
I can only deduce based on the log results, so I can judge that the judgment here may be wrong.
Can you help me analyze the reason?
//Get the business date of the day
businessDate = BusinessDay::getBusinessDay(#DateCategory_Day, 0);
// Get the date one year ago
businessLastYearDay = uaBusinessDay::getBusinessDay(#DateCategory_Day, -364);
lastYearBusinessDayStr = date2str(businessLastYearDay,DateFormat::YMD,
DateDay::Digits2,DateSeparator::None,
DateMonth::Digits2,DateSeparator::None,
DateYear::Digits2,DateFlags::None);
// Get the date after one month
businessNextMonthDay = BusinessDay::getBusinessDay('03', 1);
nextMonthBusinessDayStr = date2str(businessNextMonthDay,DateFormat::YMD,
DateDay::Digits2,DateSeparator::None,
DateMonth::Digits2,DateSeparator::None,
DateYear::Digits2,DateFlags::None);
VoucherDate = ‘220701’ ;
// Time valid range check
if (VoucherDate < lastYearBusinessDayStr||VoucherDate > nextMonthBusinessDayStr)
{
errorMessage = "Time error";
}