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

Is there a way to return monthname when you use group_by_month? #15

Open
acp15ak opened this issue Dec 5, 2015 · 1 comment
Open

Is there a way to return monthname when you use group_by_month? #15

acp15ak opened this issue Dec 5, 2015 · 1 comment

Comments

@acp15ak
Copy link

acp15ak commented Dec 5, 2015

I am using:
PurchaseHistory.group_by_month(:purchase_date,"sum","quantity*price")
It returns the following output:
"2015-08-01 00:00:00 UTC"=>40.0
Is there a way to get monthname instead of the whole timestamp?

@rusgrafx
Copy link

Haven't tried dateslices yet, but in Groupdate it could be done with 'format' like that:

.group_by_month(:purchase_date,"sum","quantity*price", format: '%b')

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

No branches or pull requests

2 participants