Skip to content

Commit

Permalink
fix artwork end time
Browse files Browse the repository at this point in the history
  • Loading branch information
antiantivirus committed Sep 16, 2024
1 parent c07da45 commit c23bf16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions components/submission/showSubmissionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default function ShowSubmissionForm({
number: "",
showName: "",
datetime: initial ? initial.date : "",
datetimeEnd: initial ? initial.dateEnd : "",
length: "1",
genres: [],
hasNewGenres: false,
Expand Down
10 changes: 5 additions & 5 deletions pages/api/show-submission-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ const socialImage = async (values) => {
values.artists.map((x) => x.label).join(", ")
);

// Parse the start time and calculate the end time
const startTime = dayjs(values.datetime).utc();
const endTime = startTime.add(values.length, "hour");

// Format the date and time
const date = encodeURIComponent(
`${startTime.format("ddd DD MMM / HH:mm")}-${endTime.format("HH:mm")} (CET)`
`${dayjs(values.datetime).utc().format("ddd DD MMM / HH:mm")}-${dayjs(
values.datetimeEnd
)
.utc()
.format("HH:mm")} (CET)`
);

// Determine the base URL based on the environment
Expand Down
1 change: 1 addition & 0 deletions types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export type SubmissionFormValues = {
number: string;
showName: string;
datetime: string;
datetimeEnd: string;
length: string;
genres: Array<{ value: string; label: string }>;
hasNewGenres: Boolean;
Expand Down

0 comments on commit c23bf16

Please sign in to comment.