Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for Google's Timeline chart: https://developers.google.com/chart/interactive/docs/gallery/timeline
Note that the first two commits, 1 2, are fixes for #64 - I merged them in here so I could work off my branch before this is merged into the gem. The interesting stuff is in this commit.
The Timeline chart is able to plot stuff across date ranges, or across times within a date. It does this by expecting a
new Date(0, 0, 0,...)
if you are only interested in the times (example). To allow the gem to handle this, I've added a new column type -timewithoutdate
. It expects a RubyTime
orDateTime
for validation purposes, then coerces it into the form required for the chart, outputting it as if it's adatetime
.If you want to make a dated timeline (example) you should just set your column type as
date
rather thantimewithoutdate
. Happy to help with documentation on the examples site.If you had other ideas about how to manage this sort of "weird" handling of dates I'm certainly happy to hear it - this seemed like the simplest solution to me, and so far I haven't come across any leaks in the abstraction.