Skip to content

Group values by year, month, day #77

Answered by stephencelis
thinkpractice asked this question in Q&A
Discussion options

You must be logged in to vote

@thinkpractice Ah, that's true, currently you must specify the type if it can't be inferred, and at the moment it can't here. So you'd need to do:

.group { #sql("date(\($0.timestamp))", as: Date?.self) }

We can look into if it's possible to weaken this requirement, though!

As for making the api easier, maybe some overload for these functions?

If you are able to define them in reasonable ways we'd be happy to consider them for inclusion in the library, but they are complicated in how they accept various inputs (dates, text, integers, doubles) and how they can fail.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@thinkpractice
Comment options

@stephencelis
Comment options

Answer selected by thinkpractice
@stephencelis
Comment options

@thinkpractice
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants