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

Add calculated field recorded_end_date to AudioRecording's filter options #261

Closed
atruskie opened this issue Mar 2, 2016 · 9 comments
Closed

Comments

@atruskie
Copy link
Member

atruskie commented Mar 2, 2016

Request: and calculated field recorded_end_date to the filter options in the AudioRecording model.

This field would be defined as:

recorded_end_date = recorded_date + duration_seconds

This field will be useful in completing the saved search story. E.g. find all recordings that have content past a certain date.

@atruskie
Copy link
Member Author

atruskie commented Mar 2, 2016

👍 - more complicated than I expected but very cool. Cheers.

@cofiem
Copy link
Contributor

cofiem commented Mar 2, 2016

😃 yeah, I had to use arel to construct the query.

It's like there's a gremlin in the system that sees your issues, and fixes them.....

@cofiem
Copy link
Contributor

cofiem commented Mar 2, 2016

Be aware that that dates you send must be in utc, and prefer using Z over +0000. I had trouble getting some offsets and time zone names to parse correctly, since the filter system doesn't use ActiveRecord's datetime conversion.

@atruskie
Copy link
Member Author

atruskie commented Mar 2, 2016

hmm... that could represent a serious problem. Does this affect all date fields used in all filters? Or just this custom one?

@cofiem
Copy link
Contributor

cofiem commented Mar 2, 2016

I think this would affect all date fields in filters (other parts of API should be fine).

@atruskie
Copy link
Member Author

atruskie commented Mar 3, 2016

One last question: does it throw an error with bad timezones it fails to parse or does it silently continue?

@cofiem
Copy link
Contributor

cofiem commented Mar 3, 2016

I hate to say it, but I think it silently continues with whatever it thought the datetime is 😞

@cofiem
Copy link
Contributor

cofiem commented Mar 3, 2016

This... probably... definitely needs a bit more work...

@atruskie
Copy link
Member Author

atruskie commented Mar 3, 2016

It is a separate issue, tracked in #263

@atruskie atruskie closed this as completed Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants