-
Notifications
You must be signed in to change notification settings - Fork 24
Render date ranges #59
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
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 date [CiteProc::Date] | ||
# @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature of this could be changed to take a CiteProc::DatePart
for date
if seasons are rendered differently (see below)
end | ||
|
||
when node.month? | ||
case | ||
# TODO support seasons in date parts! |
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.
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