Skip to content

Commit

Permalink
增加GetCrossedMonths支持
Browse files Browse the repository at this point in the history
  • Loading branch information
echo766 committed Dec 30, 2024
1 parent 144120c commit 509cf98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llbc/src/core/time/Time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ int LLBC_Time::GetCrossedMonths(const LLBC_Time &from,
if (UNLIKELY(timeOfMonth >= LLBC_TimeSpan::oneDay*31))
return 0;

const static auto preMonthMaxDays = [](int year, int month) {
const static auto preMonthMaxDays = [](int year, int month)
{
month = (month == 0) ? 11 : month - 1;
if (month == 1)
return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;
Expand Down

0 comments on commit 509cf98

Please sign in to comment.