Changeset 2473


Ignore:
Timestamp:
Jul 31, 2006, 9:11:09 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #303: News items are not shown in View -> home page

Needed a check for null endDate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/my_base/index.jsp

    r2425 r2473  
    122122  Expression today = Expressions.parameter("today");
    123123  newsQuery.restrict(Restrictions.lteq(Hql.property("startDate"), today));
    124   newsQuery.restrict(Restrictions.gteq(Hql.property("endDate"), today));
     124  newsQuery.restrict(
     125    Restrictions.or(
     126      Restrictions.gteq(Hql.property("endDate"), today),
     127      Restrictions.eq(Hql.property("endDate"), null)
     128    )
     129  );
    125130  newsQuery.order(Orders.desc(Hql.property("newsDate")));
    126131  newsQuery.setParameter("today", new Date(), Type.DATE);
Note: See TracChangeset for help on using the changeset viewer.