fix: return text only for relative date

This commit is contained in:
Stephen Zhou
2025-10-27 21:42:06 +08:00
parent 19d92cf57e
commit 3dfd55a164
@@ -14,10 +14,14 @@ export interface DateRange {
}
const formatRangeValue = (range: DateRange, text?: string): string => {
if (text) {
return `<mention-date text="${text}"></mention-date>`
}
const startIso = range.start.format(MENTION_DATE_VALUE_FORMAT)
const endIso = range.end.format(MENTION_DATE_VALUE_FORMAT)
return `<mention-date start="${startIso}" end="${endIso}"${text ? ` text="${text}"` : ""}></mention-date>`
return `<mention-date start="${startIso}" end="${endIso}"></mention-date>`
}
const formatLocalizedDate = (date: Dayjs, locale: string, template = "LLL"): string => {