Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.example.projektarendehantering.infrastructure.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;

import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

@Configuration
public class WebConfig {

private static final DateTimeFormatter DISPLAY_FORMAT =
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.of("Europe/Stockholm"));

@Bean
public Converter<Instant, String> instantToStringConverter() {
return DISPLAY_FORMAT::format;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
2 changes: 1 addition & 1 deletion src/main/resources/templates/audit/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h2 style="margin:0;">Audit Log</h2>
</thead>
<tbody>
<tr th:each="e : ${events.content}">
<td th:text="${#temporals.format(e.occurredAt, 'yyyy-MM-dd HH:mm:ss', 'UTC')}">time</td>
<td th:text="${{e.occurredAt}}">time</td>
<td>
<div th:text="${e.actorRole}">role</div>
<div class="muted" th:text="${e.actorId}">actor</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/cases/closed.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Closed Cases</h1>
<tbody>
<tr th:each="c : ${cases}">
<td th:text="${c.title}">Title</td>
<td th:text="${c.createdAt}">Date</td>
<td th:text="${{c.createdAt}}">Date</td>
<td>
<a th:href="@{/ui/cases/{id}(id=${c.id})}" class="button button-secondary">View</a>
</td>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/cases/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Case</h1>
</div>
<div class="kv">
<div class="k">Created At</div>
<div class="v" th:text="${case.createdAt}">Date</div>
<div class="v" th:text="${{case.createdAt}}">Date</div>
</div>

<hr style="border: 0; border-top: 1px solid var(--border); margin: 20px 0;"/>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h2>Notes</h2>
<p th:text="${note.content}">Note content</p>
<div class="muted" style="font-size: 0.8em;">
<span th:text="${note.authorDisplayName} ?: (${note.authorGithubUsername} ?: ${note.authorRole})">Author</span> -
<span th:if="${note.createdAt != null}" th:text="${note.createdAt}">Date</span>
<span th:if="${note.createdAt != null}" th:text="${{note.createdAt}}">Date</span>
</div>
</div>
<p th:if="${#lists.isEmpty(case.notes)}" class="muted">No notes yet.</p>
Expand All @@ -100,7 +100,7 @@ <h2>Documents</h2>
<a th:href="@{/ui/cases/{caseId}/documents/{docId}/download(caseId=${case.id}, docId=${doc.id})}" th:text="${doc.fileName}">Document.pdf</a>
<div class="muted" style="font-size: 0.8em;">
<span th:text="${#numbers.formatDecimal(doc.fileSize / 1024.0, 1, 1)} + ' KB'">123.4 KB</span> -
<span th:text="${doc.uploadedAt}">Date</span>
<span th:text="${{doc.uploadedAt}}">Date</span>
</div>
</div>
<form th:if="${currentActor != null and currentActor.role().name() != 'PATIENT'}"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/cases/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>Cases</h1>
<tbody>
<tr th:each="c : ${cases}">
<td th:text="${c.title}">Title</td>
<td th:text="${c.createdAt}">Date</td>
<td th:text="${{c.createdAt}}">Date</td>
<td>
<span
th:if="${currentActor != null && currentActor.role() != null && currentActor.role().toString() == 'PATIENT' && c.status != null && c.status.toString() != 'CREATED'}"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/employees/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>User Mappings (Employees)</h1>
<td class="code" th:text="${e.githubUsername}">Username</td>
<td th:text="${e.role}">Role</td>
<td class="code" th:text="${e.id}">UUID</td>
<td th:text="${e.createdAt}">Date</td>
<td th:text="${{e.createdAt}}">Date</td>
<td>
<a class="button button-small" th:href="@{/ui/employees/edit/{id}(id=${e.id})}">Edit</a>
<form th:action="@{/ui/employees/delete/{id}(id=${e.id})}" method="post" style="display:inline"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/patients/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1>Registered Patients</h1>
<td th:text="${p.firstName}">First</td>
<td th:text="${p.lastName}">Last</td>
<td class="code" th:text="${p.personalIdentityNumber}">PIN</td>
<td th:text="${p.createdAt}">Date</td>
<td th:text="${{p.createdAt}}">Date</td>
<td>
<a class="button button-small" th:href="@{/ui/patients/edit/{id}(id=${p.id})}">Edit</a>
</td>
Expand Down