Fix off-by-one bug in iso_week::year_lastweek_weekday
* The conversion from year_lastweek_weekday to sys_days and local_days had an off by one error. * Added test for this case.
This commit is contained in:
1 parent
87ed7f83cf
commit
c513a20691
2 files changed
+13
-2
No files matched your search
@@ -1314,7 +1314,7 @@ inline
|
||||
year_lastweek_weekday::operator sys_days() const NOEXCEPT
|
||||
{
|
||||
return sys_days(date::year{static_cast<int>(y_)}/date::dec/date::thu[date::last])
|
||||
+ (mon - thu) - (mon - wd_);
|
||||
+ (sun - thu) - (sun - wd_);
|
||||
}
|
||||
|
||||
CONSTCD14
|
||||
@@ -1322,7 +1322,7 @@ inline
|
||||
year_lastweek_weekday::operator local_days() const NOEXCEPT
|
||||
{
|
||||
return local_days(date::year{static_cast<int>(y_)}/date::dec/date::thu[date::last])
|
||||
+ (mon - thu) - (mon - wd_);
|
||||
+ (sun - thu) - (sun - wd_);
|
||||
}
|
||||
|
||||
CONSTCD11
|
||||
|
||||
Reference in new issue
Block a user