This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sorting by date


Katie McNally wrote:
> 
> The format of the dates returned in my XML is 17-Dec-2000 07:23:32.  I need
> to display dates as 12/17/00.  I am formatting the dates I display by
> calling the following template:
[...snip...]

The XSLT Standard Library, http://xsltsl.sf.net/, has a date-time
module which includes a template for formatting dates.

> I am displaying the dates in a table.  The table can be sorted by the user
> by clicking on the column titles.  I am able to sort the table for all of
> the non-date columns, but do not know how to sort the table by date.

What it does *not* include is a way of parsing dates.  You have to do
that yourself :-(

Get your dates into ISO format: YYYYMMDDHHMMSS.  For example,
20011023141400
(2:14PM, 23rd October 2001).  The date value can then be treated as an
integer
for sorting purposes.  Use the date module in XSLTSL to get it back into
a human-readable form.

Cheers,
Steve Ball

-- 
Steve Ball            |   XSLT Standard Library   | Training & Seminars
Zveno Pty Ltd         |     Web Tcl Complete      |   XML XSL Schemas
http://www.zveno.com/ |      TclXML TclDOM        | Tcl, Web Development
Steve.Ball@zveno.com  +---------------------------+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]