mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-19 12:24:46 +00:00
Extend comment length
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m17s
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m17s
This commit is contained in:
parent
e2387beaa3
commit
50c691d6a2
@ -42,7 +42,7 @@ export async function addComment(prevState: { message: string }, formData: FormD
|
||||
const success_message = 'Thanks, your comment was submitted and is awaiting approval.'
|
||||
|
||||
const schema = z.object({
|
||||
comment: z.string().min(1).max(255).trim(),
|
||||
comment: z.string().min(1).max(300),
|
||||
slug: z.string(),
|
||||
parent_id: z.string().optional()
|
||||
})
|
||||
|
@ -3,7 +3,6 @@ import {
|
||||
differenceInHours,
|
||||
differenceInMinutes,
|
||||
differenceInMonths,
|
||||
differenceInSeconds,
|
||||
differenceInWeeks,
|
||||
differenceInYears
|
||||
} from 'date-fns'
|
||||
@ -17,8 +16,7 @@ export function getShortDurationFromNow(fromDateTime: string) {
|
||||
{fn: differenceInWeeks, suffix: 'w'},
|
||||
{fn: differenceInDays, suffix: 'd'},
|
||||
{fn: differenceInHours, suffix: 'h'},
|
||||
{fn: differenceInMinutes, suffix: 'm'},
|
||||
{fn: differenceInSeconds, suffix: 's'}
|
||||
{fn: differenceInMinutes, suffix: 'm'}
|
||||
]
|
||||
|
||||
for (const {fn, suffix} of units) {
|
||||
@ -28,5 +26,5 @@ export function getShortDurationFromNow(fromDateTime: string) {
|
||||
}
|
||||
}
|
||||
|
||||
return '0s'
|
||||
return '<1m'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user