Return-Path: Delivered-To: apmail-roller-commits-archive@www.apache.org Received: (qmail 75963 invoked from network); 19 Jan 2009 13:22:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2009 13:22:48 -0000 Received: (qmail 62792 invoked by uid 500); 19 Jan 2009 13:22:33 -0000 Delivered-To: apmail-roller-commits-archive@roller.apache.org Received: (qmail 62769 invoked by uid 500); 19 Jan 2009 13:22:33 -0000 Mailing-List: contact commits-help@roller.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@roller.apache.org Delivered-To: mailing list commits@roller.apache.org Received: (qmail 62747 invoked by uid 99); 19 Jan 2009 13:22:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2009 05:22:33 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2009 13:22:32 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0D95F234C495 for ; Mon, 19 Jan 2009 05:22:12 -0800 (PST) Message-ID: <199048112.1232371332053.JavaMail.jira@brutus> Date: Mon, 19 Jan 2009 05:22:12 -0800 (PST) From: "Manos Batsis (JIRA)" To: commits@roller.apache.org Subject: [jira] Created: (ROL-1780) SiteModel.getNewWeblogs javadoc fix, functionality improovement and patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org SiteModel.getNewWeblogs javadoc fix, functionality improovement and patch ------------------------------------------------------------------------- Key: ROL-1780 URL: https://issues.apache.org/roller/browse/ROL-1780 Project: Roller Issue Type: Improvement Affects Versions: 4.0.1 Reporter: Manos Batsis Assignee: Roller Unassigned Priority: Minor The patch that follows fixes the method's javadoc and adds the ability to just retrieve a list of blogs if the number of days is a negative integer Index: /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java =================================================================== --- /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java (revision 735639) +++ /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java (working copy) @@ -391,14 +391,19 @@ /* * Get most collection of Website objects, * in reverse chrono order by creationDate. - * @param offset Offset into results (for paging) - * @param len Max number of results to return + * @param sinceDays What "new" means in days + * @param length Max number of results to return */ public List getNewWeblogs(int sinceDays, int length) { List results = new ArrayList(); - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date()); - cal.add(Calendar.DATE, -1 * sinceDays); + Calendar cal = Calendar.getInstance(); + if(sinceDays < 0){ + cal.set(1970, 0, 1); + } + else{ + cal.setTime(new Date()); + cal.add(Calendar.DATE, -1 * sinceDays); + } Date startDate = cal.getTime(); try { Weblogger roller = WebloggerFactory.getWeblogger(); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.