Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java @ 4764:1cfda99c024c
DateGuesser: doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 04 Jan 2013 11:13:13 +0100 |
parents | 8195396b23ce |
children | 28fa48986ae9 |
comparison
equal
deleted
inserted
replaced
4763:8195396b23ce | 4764:1cfda99c024c |
---|---|
66 | 66 |
67 public static final int calendarMonth(int month) { | 67 public static final int calendarMonth(int month) { |
68 return Math.max(Math.min(month-1, 11), 0); | 68 return Math.max(Math.min(month-1, 11), 0); |
69 } | 69 } |
70 | 70 |
71 /** | |
72 * Guess date by trying all different patterns. | |
73 * Throws IllegalArgumentException if not able to guess. | |
74 * @param s The date to be guessed (e.g. 11.02.2001). | |
75 * @return the parsed Date. | |
76 */ | |
71 public static Date guessDate(String s) { | 77 public static Date guessDate(String s) { |
72 if (s == null || (s = s.trim()).length() == 0) { | 78 if (s == null || (s = s.trim()).length() == 0) { |
73 throw new IllegalArgumentException(); | 79 throw new IllegalArgumentException(); |
74 } | 80 } |
75 | 81 |