[OPEN-ILS-DEV] Display due date on brief display
Dan Scott
dan at coffeecode.net
Fri Feb 18 16:29:54 EST 2011
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