mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(message): remove the unfinished scheduled messages feature (#2233)
This commit is contained in:
1 parent
eeea391b63
commit
3c8466d714
125 files changed
+17
-3730
No files matched your search
@@ -23,31 +23,6 @@ export function getFormattedDateTime(timestamp: DateInput, locale: string = DEFA
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
export function getFormattedDateTimeInZone(
|
||||
isoString: string,
|
||||
timezone: string,
|
||||
locale: string = DEFAULT_LOCALE,
|
||||
hour12?: boolean,
|
||||
): string {
|
||||
try {
|
||||
const date = new Date(isoString);
|
||||
if (Number.isNaN(date.getTime())) {
|
||||
return isoString;
|
||||
}
|
||||
return getDateFormatter(locale, {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
year: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
hour12: resolveHour12(locale, hour12),
|
||||
timeZone: timezone,
|
||||
}).format(date);
|
||||
} catch {
|
||||
return isoString;
|
||||
}
|
||||
}
|
||||
|
||||
export function getFormattedShortDate(timestamp: DateInput, locale: string = DEFAULT_LOCALE): string {
|
||||
return getDateFormatter(locale, {month: 'short', day: 'numeric', year: 'numeric'}).format(parseDate(timestamp));
|
||||
}
|
||||
@@ -149,11 +124,3 @@ export function formatLastActive(date: DateInput, locale: string = DEFAULT_LOCAL
|
||||
}
|
||||
return getDateFormatter(locale, {dateStyle: 'medium', timeStyle: 'short'}).format(dateObj);
|
||||
}
|
||||
|
||||
export function formatScheduledMessage(date: DateInput, locale: string = DEFAULT_LOCALE, timeZone?: string): string {
|
||||
const dateObj = parseDate(date);
|
||||
if (Number.isNaN(dateObj.getTime())) {
|
||||
return String(date);
|
||||
}
|
||||
return getDateFormatter(locale, {dateStyle: 'medium', timeStyle: 'short', timeZone}).format(dateObj);
|
||||
}
|
||||
Reference in new issue
Block a user