Source code: gsoft/xervlet/DateTools.java
1 /*************************************************************************
2 Copyright (C) 2003 Steve Gee
3 stevesgee@cox.net
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *************************************************************************/
19
20 package gsoft.xervlet;
21
22 /**
23 No javadoc -- feel free to app it ; )
24 Mail corrections to steveg@coredata.net
25 **/
26
27 public class DateTools {
28
29 public boolean greaterThan(ParsedDate today, ParsedDate compare) {
30 boolean greater = false;
31 if (today.YEAR == compare.YEAR) {
32 if (today.MONTH == compare.MONTH) {
33 if (today.DAY > compare.DAY) {
34 greater = true;
35 }//end
36 } else if (today.MONTH > compare.MONTH) {
37 greater = true;
38 }//end if-else
39 } else if (today.YEAR > compare.YEAR) {
40 greater = true;
41 }//end if-else
42 return greater;
43 }//end dateGreaterThan
44
45
46 public boolean equalGreaterThan(ParsedDate today, ParsedDate compare) {
47 boolean greater = false;
48 if (today.YEAR == compare.YEAR) {
49 if (today.MONTH == compare.MONTH) {
50 if (today.DAY >= compare.DAY) {
51 greater = true;
52 }//end
53 } else if (today.MONTH > compare.MONTH) {
54 greater = true;
55 }
56 } else if (today.YEAR > compare.YEAR) {
57 greater = true;
58 }//end if-else
59 return greater;
60 }//end dateGreaterThan
61
62
63 }//end DateTools