Skip to content

Commit

Permalink
VKT(Frontend & Backend): Order enrollements by created_at and show se…
Browse files Browse the repository at this point in the history
…conds
  • Loading branch information
lket committed Nov 22, 2024
1 parent 8fb722c commit 5fffca5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/vkt/src/main/java/fi/oph/vkt/model/ExamEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.Table;
import java.time.LocalDate;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -53,6 +54,7 @@ public class ExamEvent extends BaseEntity {
private long maxParticipants;

@OneToMany(mappedBy = "examEvent")
@OrderBy("createdAt")
private List<Enrollment> enrollments = new ArrayList<>();

@OneToMany(mappedBy = "examEvent")
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/vkt/public/i18n/fi-FI/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"dates": {
"dateTimeFormat": "l [klo] HH.mm",
"dateTimeFormatPrecise": "l [klo] HH.mm.ss",
"timeFormat": "[klo] HH.mm",
"dateFormat": "l",
"registrationOpensAt": "klo 10.00",
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/vkt/public/i18n/sv-SE/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"dates": {
"dateTimeFormat": "l [kl.] HH.mm",
"dateTimeFormatPrecise": "l [kl.] HH.mm.ss",
"dateFormat": "l",
"timeFormat": "[kl.] HH.mm",
"registrationOpensAt": "kl. 10.00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export const ClerkEnrollmentListingRow = ({
<Text>{getSelectedPartialExamsText()}</Text>
</TableCell>
<TableCell>
<Text>{DateTimeUtils.renderDateTime(enrollment.enrollmentTime)}</Text>
<Text>
{DateTimeUtils.renderDateTimePrecise(enrollment.enrollmentTime)}
</Text>
</TableCell>
<TableCell sx={{ width: '20%' }} align="right">
{[
Expand Down
9 changes: 9 additions & 0 deletions frontend/packages/vkt/src/utils/dateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export class DateTimeUtils {
);
}

static renderDateTimePrecise(dateTime?: Dayjs) {
const t = translateOutsideComponent();

return DateUtils.formatOptionalDateTime(
dateTime,
t('vkt.common.dates.dateTimeFormatPrecise'),
);
}

static renderOpenDateTime(dateTime?: Dayjs) {
const t = translateOutsideComponent();

Expand Down

0 comments on commit 5fffca5

Please sign in to comment.