mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-26 07:53:16 +08:00
parent
575fc23c3c
commit
cd3c57932f
@ -7748,9 +7748,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
year_month_day ymd_trial = sys_days(year{Y}/January/Sunday[1]) +
|
year_month_day ymd_trial = sys_days(year{Y}/January/Sunday[1]) +
|
||||||
weeks{U-1} +
|
weeks{U-1} +
|
||||||
(weekday{static_cast<unsigned>(wd)} - Sunday);
|
(weekday{static_cast<unsigned>(wd)} - Sunday);
|
||||||
if (Y == not_a_year)
|
if (year{Y} != ymd_trial.year())
|
||||||
Y = static_cast<int>(ymd_trial.year());
|
|
||||||
else if (year{Y} != ymd_trial.year())
|
|
||||||
goto broken;
|
goto broken;
|
||||||
if (m == not_a_month)
|
if (m == not_a_month)
|
||||||
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
|
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
|
||||||
@ -7767,9 +7765,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
year_month_day ymd_trial = sys_days(year{Y}/January/Monday[1]) +
|
year_month_day ymd_trial = sys_days(year{Y}/January/Monday[1]) +
|
||||||
weeks{W-1} +
|
weeks{W-1} +
|
||||||
(weekday{static_cast<unsigned>(wd)} - Monday);
|
(weekday{static_cast<unsigned>(wd)} - Monday);
|
||||||
if (Y == not_a_year)
|
if (year{Y} != ymd_trial.year())
|
||||||
Y = static_cast<int>(ymd_trial.year());
|
|
||||||
else if (year{Y} != ymd_trial.year())
|
|
||||||
goto broken;
|
goto broken;
|
||||||
if (m == not_a_month)
|
if (m == not_a_month)
|
||||||
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
|
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user