I’m trying to really polish off the edges and provide a slick interface in our Blacklight implementation, to contrast with the very hacky legacy OPAC.
Applied to the display of your items out with due dates… In a display of due dates, the user has to do some arithmatic to figure out how far away a given date is. What they really care about is, is this tomorrow? In a week? In a month?
So why not display it to them? There’s a nice Rails helper to calculate human readable time deltas, although I customized it just a bit to handle the fact that some of our due dates have specific times attached (like for reserves; I use a ruby Time object), and others are just dates with no time, before close of business (I use ruby Date object). The built-in method alone works with Dates, but doesn’t always do the most sensible thing with them for this case.
# handle both Date's without a time, and Time's with hour/minute/second # appropriately. def relative_due_date(date_or_time) if date_or_time.kind_of?(Time) distance_of_time_in_words( Time.now, date_or_time) elsif date_or_time == Date.today "today" elsif (date_or_time == (Date.today + 1)) "tomorrow" else distance_of_time_in_words( Date.today, date_or_time) end end
There are other corners that it wasn’t really feasible to polish off based on the functionality and business rules of the underlying ILS. Like if the item isn’t renewable, I’d rather now show a renew button at all, instead showing the reason it’s not renewable. But the underlying ILS doesn’t really support that, you have to click ‘renew’ first, and then (maybe, sometimes) get a reason if it wasn’t renewable. So I polished off what I could within reasonable constraints — like at least in this interface if you choose ‘renew all’, it specifically marks which items were renewed and which weren’t, instead of the legacy OPAC that just let you look at the new due dates without telling you if they were actually new or the same old ones due to not being renewable. Oh well.