Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

YEARWEEK UDF function #628

Merged
merged 1 commit into from
Apr 11, 2019
Merged

YEARWEEK UDF function #628

merged 1 commit into from
Apr 11, 2019

Conversation

kuba--
Copy link
Contributor

@kuba-- kuba-- commented Mar 1, 2019

Signed-off-by: kuba-- kuba@sourced.tech
Closes: #616

The solution was partly taken from tidb.


// calcDaysInYear calculates days in one year, it works with 0 <= yyyy <= 99.
func calcDaysInYear(yyyy int32) int32 {
if (yyyy&3) == 0 && (yyyy%100 != 0 || (yyyy%400 == 0 && (yyyy != 0))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like a calculation of isLeapYear is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it's

@kuba-- kuba-- requested a review from a team March 22, 2019 09:35
Copy link
Contributor

@ajnavarro ajnavarro left a comment

Choose a reason for hiding this comment

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

@kuba-- could you add the new Function to README and SUPPORTED md files?

@kuba--
Copy link
Contributor Author

kuba-- commented Apr 10, 2019

@ajnavarro - done (added to docs + rebase)

Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba--
Copy link
Contributor Author

kuba-- commented Apr 11, 2019

done

@ajnavarro ajnavarro merged commit 89c0734 into src-d:master Apr 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants