feat: support user-related placeholders in submission templates and standardize display time to Asia/Bangkok timezone

This commit is contained in:
2026-06-29 20:30:06 +07:00 Unverified
parent 56eaf61cef
commit f9b423eded
4 changed files with 14 additions and 7 deletions
@@ -77,14 +77,14 @@ export default function SubmissionDetailClient({
<div className="flex items-center gap-2 text-muted-foreground">
<Calendar className="w-4 h-4 shrink-0" />
<span className="font-semibold text-foreground">Initial Submission:</span>
<span>{new Date(submission.submittedAt).toLocaleString(undefined, { hour12: false })}</span>
<span>{new Date(submission.submittedAt).toLocaleString("en-US", { timeZone: "Asia/Bangkok", hour12: false })}</span>
</div>
{editHistory.length > 0 && (
<div className="flex flex-col mt-2 pt-2 border-t">
<span className="font-semibold text-foreground mb-1">Edit History:</span>
<ul className="list-disc list-inside text-xs text-muted-foreground space-y-1">
{editHistory.map((edit, idx) => (
<li key={idx}>Edited at {new Date(edit.editedAt).toLocaleString(undefined, { hour12: false })}</li>
<li key={idx}>Edited at {new Date(edit.editedAt).toLocaleString("en-US", { timeZone: "Asia/Bangkok", hour12: false })}</li>
))}
</ul>
</div>
@@ -197,7 +197,7 @@ export default function SubmissionDetailClient({
>
<div className="flex items-center gap-1 text-xs text-muted-foreground">
<Clock className="w-3 h-3 shrink-0" />
<span>{new Date(entry.editedAt).toLocaleString()}</span>
<span>{new Date(entry.editedAt).toLocaleString("en-US", { timeZone: "Asia/Bangkok", hour12: false })}</span>
</div>
<span className="text-sm text-foreground/80 whitespace-pre-wrap leading-relaxed">
{entry.answer || <span className="italic text-muted-foreground">No response</span>}