From 9b14344be37fae5a1fcf6ff3402851b3bbdd9369 Mon Sep 17 00:00:00 2001 From: NEUpanning Date: Thu, 10 Oct 2024 10:29:57 +0800 Subject: [PATCH] update after cr --- velox/functions/lib/DateTimeFormatter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/velox/functions/lib/DateTimeFormatter.cpp b/velox/functions/lib/DateTimeFormatter.cpp index d0b5868c4efd..037d2fa869c2 100644 --- a/velox/functions/lib/DateTimeFormatter.cpp +++ b/velox/functions/lib/DateTimeFormatter.cpp @@ -53,9 +53,8 @@ struct Date { bool centuryFormat = false; bool isYearOfEra = false; // Year of era cannot be zero or negative. - bool hasYear = false; - // Whether dayOfWeek was explicitly specified. - bool hasDayOfWeek = false; + bool hasYear = false; // Whether year was explicitly specified. + bool hasDayOfWeek = false; // Whether dayOfWeek was explicitly specified. int32_t hour = 0; int32_t minute = 0; @@ -999,10 +998,10 @@ int32_t parseFromPattern( } } date.dayOfWeek = number; + date.hasDayOfWeek = true; if (!date.weekOfMonthDateFormat) { date.weekDateFormat = true; } - date.hasDayOfWeek = true; date.dayOfYearFormat = false; if (!date.hasYear) { date.hasYear = true;