-
Notifications
You must be signed in to change notification settings - Fork 0
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
Calendar colors & code #157
Conversation
Alternate single-day entries with blue colors Alternate multi-day entries with orange and red-orange Compress JSON output by using HEREDOC with squish I saw this in some Rails source code and noted for future use :-) Add some whitespace and alphabetize some things
Use constants for output file and Solr URL Use easier syntax for fields array Add preliminary Solr request to retrieve # of rows query matches, so not relying on hard-coded rows number Use shorter Solr query syntax Print output so there is some feedback in the terminal Catch case that Solr index has no entries or failed, exit, and inform user
Calendar element would empty temporarily while redrawing new year's data and the footer would jump up and back down quickly Set min-height on #calendar so the footer remains below the display area
if SOLR_URL | ||
$solr = RSolrCdrh::Query.new(SOLR_URL, fields) | ||
|
||
# Retrieve # of rows first so not relying on hard-coded limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using "rows" => 0
crashes, thus using 1. Using smallest field list minimizes data transfer of the prelim query.
Importance of not using really high Solr rows value, which links to a JIRA issue whose comments inspired this approach: http://stackoverflow.com/questions/10039778/how-to-get-all-results-from-solr-query#comment67310298_10080733
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why rows => 0 was crashing? I wonder if it's one of the gem layers, it seems like that shouldn't bother solr itself at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I haven't tested it out locally, so I can do that if you want, but otherwise I think it's ready to merge
if SOLR_URL | ||
$solr = RSolrCdrh::Query.new(SOLR_URL, fields) | ||
|
||
# Retrieve # of rows first so not relying on hard-coded limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why rows => 0 was crashing? I wonder if it's one of the gem layers, it seems like that shouldn't bother solr itself at all.
y1, m1, d1 = date1.split("-") | ||
y2, m2, d2 = date2.split("-") | ||
# javascript sucks at dates, so help it out | ||
|
||
# javascript uses zero-indexed months |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stand by my comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;-)
It would be nicer if everything worked the same so one didn't have to remember this, or be reminded by a later bug / inaccuracy. I'm used to Perl and JS being zero-indexed so the chore has been normalized for me.
Closes #105