Ignore:
Timestamp:
2018-11-24T15:00:43+01:00 (5 years ago)
Author:
Don-vip
Message:

see #16995 - use_Date exclusively for PT_TIME attribute (patch by cmuelle8)

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

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

    r14153 r14446  
    3434import org.openstreetmap.josm.spi.preferences.Config;
    3535import org.openstreetmap.josm.tools.GBC;
    36 import org.openstreetmap.josm.tools.Logging;
    37 import org.openstreetmap.josm.tools.UncheckedParseException;
    3836import org.openstreetmap.josm.tools.date.DateUtils;
    3937
     
    8179                                n.put(key, str);
    8280                            }
    83                             if (GpxConstants.PT_TIME.equals(key)) {
    84                                 // timestamps should always be converted
    85                                 try {
    86                                     n.setTimestamp(DateUtils.fromString(str));
    87                                 } catch (UncheckedParseException e) {
    88                                     Logging.log(Logging.LEVEL_WARN, e);
    89                                 }
    90                             }
    9181                        } else if (obj instanceof Date && GpxConstants.PT_TIME.equals(key)) {
    9282                            // timestamps should always be converted
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r14079 r14446  
    1313import java.util.ArrayList;
    1414import java.util.Collection;
    15 import java.util.Date;
    1615import java.util.HashMap;
    1716import java.util.LinkedList;
     
    260259    public WayPoint convertToWayPoint() {
    261260        WayPoint wpt = new WayPoint(getCoor());
    262         wpt.put(GpxConstants.PT_TIME, timeFormatter.format(new Date(Math.round(time * 1000))));
     261        wpt.setTime((long) (time*1000));
    263262        if (text != null) {
    264263            wpt.addExtension("text", text);
Note: See TracChangeset for help on using the changeset viewer.