Ignore:
Timestamp:
2021-04-08T22:56:06+02:00 (3 years ago)
Author:
simon04
Message:

see #14176 - Migrate GPX to Instant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java

    r16553 r17715  
    77import java.awt.GridBagLayout;
    88import java.awt.event.ActionListener;
     9import java.time.Instant;
    910import java.time.ZoneId;
    1011import java.time.ZonedDateTime;
     
    5253
    5354        final Date startTime, endTime;
    54         Date[] bounds = layer.data.getMinMaxTimeForAllTracks();
    55         startTime = (bounds.length == 0) ? Date.from(ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()).toInstant()) : bounds[0];
    56         endTime = (bounds.length == 0) ? new Date() : bounds[1];
     55        Instant[] bounds = layer.data.getMinMaxTimeForAllTracks();
     56        if (bounds.length == 0) {
     57            startTime = Date.from(ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()).toInstant());
     58            endTime = new Date();
     59        } else {
     60            startTime = Date.from(bounds[0]);
     61            endTime = Date.from(bounds[1]);
     62        }
    5763
    5864        dateFrom.setDate(startTime);
Note: See TracChangeset for help on using the changeset viewer.