[OPEN-ILS-DEV] Display due date on brief display

Dan Wells dbw2 at calvin.edu
Fri Feb 18 17:08:56 EST 2011


Hello Grant,

Dan's solution looks great, but I wanted to add that in 2.0 only there is also a 'open-ils.circ.copy.due_date.retrieve' method which will get just the due date and nothing else, which could save on some overhead if you really just need the date.  Let us know if you want to try it and need any help dropping it in to Dan's code.

Dan

>>> On 2/18/2011 at 4:29 PM, Dan Scott <dan at coffeecode.net> wrote:
> On Thu, Feb 17, 2011 at 03:35:14PM -0400, Grant Johnson wrote:
>> Hi,
>> 
>> Dan gave UPEI some awesome functionality that display's Call Number,
>> Location and Status on the brief results screen.
>> As well as the Due-Date in the full record display.
>> 
>> The dojo query that returns Status is:
>> 
>>    dojo.query('status', cp).forEach(function (status) {
>>       var pfx = dojo.doc.createTextNode(' (');
>>       output.appendChild(pfx);
>>       dojo.create('b', { "innerHTML":
>> dojox.xml.parser.textContent(status)  }, output);
>>       var sfx = dojo.doc.createTextNode(')');
>>       output.appendChild(sfx);
>>      });
>> 
>> 
>> Can I, should I, How would I...  modify/add the Due-Date in the brief
>> results when the status is "checked-out".
> 
> On 2.0, you can replace that chunk of text with the chunk at
> http://paste.lisp.org/display/119822 (see the annotation for better date
> formatting).
> 
> Caveats: that code tests against the English value for "Checked out"
> which isn't guaranteed to be the case for other languages, and uses a
> hard coded string for "Due date". And it has only been tested on Firefox
> and Chrome.
> 
> Also, the dojo.date.locale.format function formats the date according to
> the browser language preference, so most people with a default en-us
> language preference get the questionable MM/dd/YY format instead of the
> perfectly sensible YYYY-MM-DD. You can override this in the options.
> 
> Hopefully this is a start, anyway.



More information about the Open-ils-dev mailing list