- Timestamp:
- 2016-01-31T16:17:34+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r9693 r9701 39 39 import org.openstreetmap.josm.tools.Geometry; 40 40 import org.openstreetmap.josm.tools.Predicate; 41 import org.openstreetmap.josm.tools.UncheckedParseException; 41 42 import org.openstreetmap.josm.tools.Utils; 42 43 import org.openstreetmap.josm.tools.date.DateUtils; … … 177 178 String rangeA1 = rangeA[0].trim(); 178 179 String rangeA2 = rangeA[1].trim(); 179 // if min timestap is empty: use lowest possible date 180 long minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime(); 181 // if max timestamp is empty: use "now" 182 long maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); 180 final long minDate; 181 final long maxDate; 182 try { 183 // if min timestap is empty: use lowest possible date 184 minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime(); 185 } catch (UncheckedParseException ex) { 186 throw new ParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex); 187 } 188 try { 189 // if max timestamp is empty: use "now" 190 maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); 191 } catch (UncheckedParseException ex) { 192 throw new ParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex); 193 } 183 194 return new TimestampRange(minDate, maxDate); 184 195 } else {
Note:
See TracChangeset
for help on using the changeset viewer.