Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DayOfYear, DayOfMonth, DayOfWeek Functions #2467

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

kche0169
Copy link
Contributor

What problem does this PR solve?

Ad DayOfYear, DayOfMonth, DayOfWeek Functions

Issue link: (#2033)

Type of change

  • New Feature (non-breaking change which adds functionality)
  • Test cases

@kche0169 kche0169 self-assigned this Jan 16, 2025
@kche0169 kche0169 added the wip work in progress label Jan 16, 2025
@JinHai-CN JinHai-CN changed the title Ad DayOfYear, DayOfMonth, DayOfWeek Functions Add DayOfYear, DayOfMonth, DayOfWeek Functions Jan 16, 2025
@kche0169 kche0169 added ci PR can be test and removed wip work in progress labels Jan 16, 2025
@kche0169 kche0169 added ci PR can be test and removed ci PR can be test labels Jan 16, 2025
@kche0169 kche0169 requested a review from JinHai-CN January 16, 2025 12:27
@@ -414,5 +414,7 @@ int64_t DateType::GetDatePart(DateType input, TimeUnit unit) {
}
return -1;
}

bool DateType::OuterDate2YMD(DateType input, int32_t &year, int32_t &month, int32_t &day) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use i32 to replace i32_t

@@ -69,6 +69,8 @@ struct DateType {
static bool Subtract(DateType input, IntervalType interval, DateType &output);

static int64_t GetDatePart(DateType input, TimeUnit unit);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use i64 to replace int64_t

// See the License for the specific language governing permissions and
// limitations under the License.
module;
#include <__chrono/weekday.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the header file look so weird?


module;

import stl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move import after 'export module day_of_month;'


module;

import stl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move import after 'export module xxxx'


module;

import stl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move import after 'export module xxxx'

@@ -59,6 +59,8 @@ struct DateTypeStd {
static bool Subtract(DateTypeStd input, IntervalType interval, DateTypeStd &output);

static int64_t GetDatePart(DateTypeStd input, TimeUnit unit);

static bool OuterDate2YMD(int32_t days, std::chrono::year_month_day &ymd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int32_t -> i32

@@ -108,4 +108,14 @@ bool DateTimeType::IsDateTimeValid(int32_t year, int32_t month, int32_t day, int
return TimeType::IsTimeValid(hour, minute, second) and DateType::IsDateValid(year, month, day);
}


bool DateTimeType::OuterDateTime2YMD(int32_t days, std::chrono::year_month_day &ymd) {
int32_t year, month, day;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int32_t->i32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci PR can be test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants