I have the same problem (altough I've used different data format). I solved
this by introducing new class which toString method returns formatted date
and compareTo() compares actual dates. Here is the code:
public class FormattedDate implements Comparable, Serializable {
private Date date;
private String formattedDate;
private static SimpleDateFormat df;
static {
df = new SimpleDateFormat("dd.MM.yyyy");
}
public FormattedDate(Date date) {
this.date = date;
formattedDate = df.format(date);
}
public int compareTo(Object o) {
if (o instanceof FormattedDate) {
FormattedDate other = (FormattedDate) o;
return this.date.compareTo(other.date);
}
return 0;
}
public String toString() {
return formattedDate;
}
}
So, for every date column I need to sort I have corresponding FormattedDate.
Maybe there are simpler solutions but this works for me...
Dejan
----- Original Message -----
From: "Krishnan, Mahesh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 30, 2004 3:48 PM
Subject: [displaytag-user] RE: [displaytag-user]sorting on date field
> Hi
> While sorting on a date field, the column is not sorted correctly. I am
using mm/dd/yyyy format. Any Suggestions
>
> Thanks
>
> -----Original Message-----
> From: Matt Raible [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 28, 2004 11:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [displaytag-user] filter
>
>
> This is not an out of the box feature - feel free to provide ideas on
> how we could implement this (or why ;-).
>
> Matt
>
> On Jan 26, 2004, at 5:05 AM, Otto, Frank wrote:
>
> > Hi,
> >
> > is there any possibility to filter a table? For example I want to
> > print only rows with a 'A%' in the column name.
> >
> > Has anyone an idea?
> >
> >
> > Regards,
> >
> > Frank
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> displaytag-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
>
============================================================================
==
> This message is for the sole use of the intended recipient. If you
received this message in error please delete it and notify us. If this
message was misdirected, CSFB does not waive any confidentiality or
privilege. CSFB retains and monitors electronic communications sent through
its network. Instructions transmitted over this system are not binding on
CSFB until they are confirmed by us. Message transmission is not guaranteed
to be secure.
>
============================================================================
==
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> displaytag-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user