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

YearWeek #434

Closed
Ghalleb opened this Issue Jun 5, 2013 · 6 comments

Comments

Projects
None yet
2 participants
@Ghalleb

Ghalleb commented Jun 5, 2013

It would be usefull to have a YearWeek function the same way we have a YearMonth one.

The result would be:

extract(year from field) * 100 
+ extract(week from field)

@timowest timowest closed this Jun 9, 2013

@timowest timowest reopened this Jun 9, 2013

@timowest timowest closed this Jun 9, 2013

@timowest timowest reopened this Jun 9, 2013

@timowest timowest closed this Jun 9, 2013

@timowest timowest reopened this Jun 9, 2013

@timowest timowest closed this Jun 9, 2013

@timowest timowest reopened this Jun 9, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 9, 2013

Member

Sorry for the close/reopen switches.

Member

timowest commented Jun 9, 2013

Sorry for the close/reopen switches.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 9, 2013

Member

YearWeek is now available as yearWeek().

Member

timowest commented Jun 9, 2013

YearWeek is now available as yearWeek().

@Ghalleb

This comment has been minimized.

Show comment
Hide comment
@Ghalleb

Ghalleb Jun 10, 2013

A question:

What will yearWeek for the 1st January will return?

Sometimes 1st January is in week 1 of week 52 or week 53...
This is because of the iso week definition(http://en.wikipedia.org/wiki/ISO_week_date)

For exemple 1 Jan 2005 is 2004 W53 but 1 Jan 2008 is 2008 W1.

Week function in SQL is always a little bit messy

Ghalleb commented Jun 10, 2013

A question:

What will yearWeek for the 1st January will return?

Sometimes 1st January is in week 1 of week 52 or week 53...
This is because of the iso week definition(http://en.wikipedia.org/wiki/ISO_week_date)

For exemple 1 Jan 2005 is 2004 W53 but 1 Jan 2008 is 2008 W1.

Week function in SQL is always a little bit messy

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 10, 2013

Member

The implementation is based on year * 100 + week.

I can try to implement it as an ISO compliant year week access instead.

Member

timowest commented Jun 10, 2013

The implementation is based on year * 100 + week.

I can try to implement it as an ISO compliant year week access instead.

@timowest timowest closed this Jun 10, 2013

@timowest timowest reopened this Jun 10, 2013

@Ghalleb

This comment has been minimized.

Show comment
Hide comment
@Ghalleb

Ghalleb Jun 10, 2013

I think the ISO compliant would be better.

Ghalleb commented Jun 10, 2013

I think the ISO compliant would be better.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 26, 2013

Member

Released in 3.2.1

Member

timowest commented Jun 26, 2013

Released in 3.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment