Skip to content

Commit 6805081

Browse files
committed
clean simpleDateFormat declaration, and proposed date format in properties
1 parent 2576ee6 commit 6805081

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/ui/snapshot/SnapshotController.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,9 @@ private void takeSnapshot() {
289289
List<TableEntry> tableEntries = createTableEntries(snapshots.get(0));
290290
snapshotTable.updateTable(tableEntries, snapshots, showLiveReadbackProperty.get(), false, showDeltaPercentage);
291291

292-
SimpleDateFormat formater = null;
293-
Date now = new Date();
294-
formater = new SimpleDateFormat("yy-MM-dd");
295-
String defaultTitle="";
296292
if (!Preferences.default_title_snapshot_date_format.equals("")) {
297-
formater = new SimpleDateFormat(Preferences.default_title_snapshot_date_format);
298-
defaultTitle+=defaultTitle+formater.format(now);
299-
snapshotNameProperty.set(defaultTitle);
293+
SimpleDateFormat formater = new SimpleDateFormat(Preferences.default_title_snapshot_date_format);
294+
snapshotNameProperty.set(formater.format(new Date()));
300295
}
301296

302297
})

app/save-and-restore/app/src/main/resources/save_and_restore_preferences.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ search_result_page_size=30
2323
default_search_query=tags=golden
2424

2525
# If declared add a date automatically in the name of the snapshot "Take Snapshot"
26-
#default_title_snapshot_date_format=YYYYMMHH_hhmmss
26+
#default_title_snapshot_date_format=yyyy-MM-dd HH:mm:ss

0 commit comments

Comments
 (0)