Changeset 14434 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2018-11-20T01:13:10+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14430 r14434 781 781 */ 782 782 public static WayPoint nodeToWayPoint(Node n) { 783 return nodeToWayPoint(n, 0);783 return nodeToWayPoint(n, Long.MIN_VALUE); 784 784 } 785 785 786 786 /** 787 787 * @param n the {@code Node} to convert 788 * @param time a time value in milliseconds from the epoch.788 * @param time a timestamp value in milliseconds from the epoch. 789 789 * @return {@code WayPoint} object 790 790 * @since 13210 … … 798 798 799 799 try { 800 if (time > 0) { 801 wpt.put(GpxConstants.PT_TIME, DateUtils.fromTimestamp(time)); 802 wpt.setTime(time); 800 if (time > Long.MIN_VALUE) { 801 wpt.setTimeInMillis(time); 803 802 } else if (n.hasKey(GpxConstants.PT_TIME)) { 804 wpt.put(GpxConstants.PT_TIME, DateUtils.fromString(n.get(GpxConstants.PT_TIME))); 805 wpt.setTime(); 803 wpt.setTime(DateUtils.fromString(n.get(GpxConstants.PT_TIME))); 806 804 } else if (!n.isTimestampEmpty()) { 807 wpt.put(GpxConstants.PT_TIME, DateUtils.fromTimestamp(n.getRawTimestamp())); 808 wpt.setTime(); 805 wpt.setTime(Integer.toUnsignedLong(n.getRawTimestamp())); 809 806 } 810 807 } catch (UncheckedParseException e) {
Note:
See TracChangeset
for help on using the changeset viewer.