Skip to content

Commit

Permalink
Improve audit timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Apr 28, 2020
1 parent be740a2 commit c781aa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,16 @@

import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.TimeZone;

public class ProjectAudit {

private AuditLogDTO log;
private int level;
private final AuditLogDTO log;
private final int level;

private static String currentTimestamp() {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
return df.format(new Date());
return OffsetDateTime.now().toString();
}

private static String getStackTrace(Exception e) {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/module/scripts/dialogs/audit-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class MetadataAuditDialog {

showLogTable(entries) {
entries.forEach((entry) => {
console.log(entry.timestamp.split("Z", 1)[0]);
const timestamp = Date.parse(entry.timestamp.split("Z", 1)[0]);
this.elements.auditTableBody.append(
$("<tr>")
Expand Down

0 comments on commit c781aa4

Please sign in to comment.