Skip to content

Commit

Permalink
OsmObjInfotDialog: Use instants
Browse files Browse the repository at this point in the history
JOSM r17712 updated Notes to use Instants, see JOSM #21008.

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jun 16, 2021
1 parent 40f1f26 commit fd11708
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="osm-obj-info" default="dist" basedir=".">
<property name="commit.message" value="Display OpenStreetMap object information"/>
<property name="plugin.main.version" value="12098"/>
<property name="plugin.main.version" value="17712"/>
<property name="plugin.author" value="Rub21"/>
<property name="plugin.class" value="org.openstreetmap.josm.plugins.osmobjinfo.OSMObjInfoPlugin"/>
<property name="plugin.description" value="Display OpenStreetMap object information"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void mouseClicked(MouseEvent e) {

private JPanel buildidObject() {

//OBJ ID
//OBJ ID
JPanel jpIdobj = new JPanel(new BorderLayout());

lbIdobj = new JLabel();
Expand All @@ -252,7 +252,7 @@ private JPanel buildidObject() {
jpIdobj.add(lbIdobj, BorderLayout.LINE_START);
jpIdobj.add(jpIdobjOptions, BorderLayout.LINE_END);

//id obj actions
//id obj actions
lbLinnkIdobj.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Expand Down Expand Up @@ -290,7 +290,8 @@ public void selection(Collection<? extends OsmPrimitive> selection) {
typeObj = element.getType().toString();
try {
user = element.getUser().getName();
timestamp = new SimpleDateFormat("yyyy/MM/dd hh:mm a").format(element.getTimestamp().getTime());
timestamp = new SimpleDateFormat("yyyy/MM/dd hh:mm a")
.format(element.getInstant().toEpochMilli());
} catch (NullPointerException e) {
user = UserIdentityManager.getInstance().getUserName();
}
Expand Down Expand Up @@ -339,7 +340,8 @@ public void getInfoNotes(MouseEvent e) {
lbIdobj.setText(Long.toString(noteLayer.getNoteData().getSelectedNote().getId()));
}
lbVersion.setText("");
lbTimestamp.setText(new SimpleDateFormat("yyyy/MM/dd hh:mm a").format(noteLayer.getNoteData().getSelectedNote().getCreatedAt()));
lbTimestamp.setText(new SimpleDateFormat("yyyy/MM/dd hh:mm a")
.format(noteLayer.getNoteData().getSelectedNote().getCreatedAt().toEpochMilli()));
}
}
}
Expand Down

0 comments on commit fd11708

Please sign in to comment.