Render date ranges#59
Conversation
| end | ||
|
|
||
| def render_date_range(date, node, parts, delimiter) | ||
| delimit_range_at = 'day' # TODO date.delimit_range_at |
There was a problem hiding this comment.
This should be implemented in CiteProc::Date to return the he largest date part (“year”, “month”, or “day”) that differs between the two dates.
| # @param node [CSL::Style::DatePart, CSL::Locale::DatePart] | ||
| # @return [String] | ||
| def render_date_part(date, node) | ||
| def render_date_part(date, node, part: 0) |
There was a problem hiding this comment.
The signature of this could be changed to take a CiteProc::DatePart for date if seasons are rendered differently (see below)
|
|
||
| when node.month? | ||
| case | ||
| # TODO support seasons in date parts! |
There was a problem hiding this comment.
Are season ranges even possible using CSL Data?
|
Hey @inukshuk , thanks for working on this! I had been trying, but I see looking at your code I wasn't even close to figuring out how to interact with the CSL nodes to do what was needed. I think it's fine if it doesn't work for some edge cases -- prior to this, it didn't work at all, so. However, I'm afraid it's not working for me for basic use cases. I am trying with a csl-data-json object that has Running this through the Trying other input with months and dates, it also is not working -- only including the end of range, and sometimes not including month/date from end of range as expected either. |
|
@jrochkind yes, this is not fully functional yet; for starters, check out the TODO at line 41 above -- the |
|
Ah, right on, thanks. Appreciate seeing the code. I'll see if I can find time to take it further -- the fact that code needs to be split between two gems, which need to have their changes and releases synchronized... makes things harder. I wonder if it makes sense to temporarily or as fallback put the func in this gem? I'll see if I can find time -- but I might end up just passing in a date with a |
Closes #58