Ignore:
Timestamp:
2021-04-11T21:56:50+02:00 (4 years ago)
Author:
simon04
Message:

see #14176 - Migrate OsmPrimitive to Instant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

    r17747 r17749  
    741741            String mv;
    742742            if ("timestamp".equals(key) && osm instanceof OsmPrimitive) {
    743                 mv = DateUtils.fromTimestamp(((OsmPrimitive) osm).getRawTimestamp());
     743                mv = ((OsmPrimitive) osm).getInstant().toString();
    744744            } else {
    745745                mv = osm.get(key);
     
    14931493            try {
    14941494                // if min timestamp is empty: use lowest possible date
    1495                 minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime();
     1495                minDate = DateUtils.parseInstant(rangeA1.isEmpty() ? "1980" : rangeA1).toEpochMilli();
    14961496            } catch (UncheckedParseException | DateTimeException ex) {
    14971497                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex);
     
    14991499            try {
    15001500                // if max timestamp is empty: use "now"
    1501                 maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime();
     1501                maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.parseInstant(rangeA2).toEpochMilli();
    15021502            } catch (UncheckedParseException | DateTimeException ex) {
    15031503                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex);
     
    15081508        @Override
    15091509        protected Long getNumber(OsmPrimitive osm) {
    1510             return osm.getTimestamp().getTime();
     1510            return osm.getInstant().toEpochMilli();
    15111511        }
    15121512
Note: See TracChangeset for help on using the changeset viewer.