twingly / twingly-search-api-ruby

:gem: Twingly Blog Search API in Ruby
https://developer.twingly.com/
MIT License
4 stars 0 forks source link

Query#start_time and #end_time should be converted to UTC #43

Closed roback closed 8 years ago

roback commented 8 years ago

Nowhere in the gem documentation do we mention that Query#start_time and Query#end_time expects that the time is in UTC. It is explained on developer.twingly.com but not here. It is explained for the Post class though.

The hello world example needs an update too (Time.now -> Time.now.utc).

jage commented 8 years ago

How about we also include a warning when it's passed non-UTC objects?

I'm thinking something like:

warn "Time needs to be in UTC" unless start_time.now.utc?
roback commented 8 years ago

Good idea.

Maby RSpec's output matcher could be used for testing.

jage commented 8 years ago

Maby RSpec's output matcher could be used for testing.

:+1:

dentarg commented 8 years ago

:+1:

roback commented 8 years ago

We have decided not to go with the warning, but instead convert start_time and end_time to UTC so the user don't have to think about that themselves. I'll update the issue title.