From 441cadead34be79a4d1a6bab5a7683b7f7227f3f Mon Sep 17 00:00:00 2001 From: Evan Mallory Date: Sun, 2 Oct 2016 20:11:22 -0400 Subject: Fix Windows strptime This fixes the datetime-related tests in testAddition and testSubtraction in the LedgerMathTests --- src/strptime.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/strptime.cc') diff --git a/src/strptime.cc b/src/strptime.cc index b9d485d2..dc08df46 100644 --- a/src/strptime.cc +++ b/src/strptime.cc @@ -70,14 +70,14 @@ static char* _strptime(const char *s, const char *format, struct tm *tm) { case 'A': tm->tm_wday = -1; for (int i = 0; i < 7; ++i) { - len = static_cast(strlen(kWeekAbbr[i])); - if (strnicmp(kWeekAbbr[i], s, len) == 0) { + len = static_cast(strlen(kWeekFull[i])); + if (strnicmp(kWeekFull[i], s, len) == 0) { tm->tm_wday = i; break; } - len = static_cast(strlen(kWeekFull[i])); - if (strnicmp(kWeekFull[i], s, len) == 0) { + len = static_cast(strlen(kWeekAbbr[i])); + if (strnicmp(kWeekAbbr[i], s, len) == 0) { tm->tm_wday = i; break; } @@ -92,14 +92,14 @@ static char* _strptime(const char *s, const char *format, struct tm *tm) { case 'h': tm->tm_mon = -1; for (int i = 0; i < 12; ++i) { - len = static_cast(strlen(kMonthAbbr[i])); - if (strnicmp(kMonthAbbr[i], s, len) == 0) { + len = static_cast(strlen(kMonthFull[i])); + if (strnicmp(kMonthFull[i], s, len) == 0) { tm->tm_mon = i; break; } - len = static_cast(strlen(kMonthFull[i])); - if (strnicmp(kMonthFull[i], s, len) == 0) { + len = static_cast(strlen(kMonthAbbr[i])); + if (strnicmp(kMonthAbbr[i], s, len) == 0) { tm->tm_mon = i; break; } -- cgit v1.2.3