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

cant use by_month if january #46

Closed
jtoy opened this issue Jan 6, 2015 · 2 comments
Closed

cant use by_month if january #46

jtoy opened this issue Jan 6, 2015 · 2 comments

Comments

@jtoy
Copy link

jtoy commented Jan 6, 2015

if its january 2015, you cant use do queries like:
.by_year('2014').by_month('december')
or
.by_month('december') #<--- this is should go to the past month, not future month.

how could you do this with just by_month?
Im trying to use by_star to pass parameters directly to the url which then get passed to by_star.

@johnnyshields
Copy link
Collaborator

It should work if you do .by_month(Time.parse('2014-12-01')), in other words pass-in a Date or Time object which is anytime in the desired month.

@johnnyshields
Copy link
Collaborator

Note also that ByStar does not currently allow repeating queries, e.g. query for all objects which happen in any December regardless of year. If this is your intention, I recommend add an additional field to your database which stores the month of the year as an integer, and write your own query for that.

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