feat: add internationalization message platform
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
export type ReferenceResourceView = Readonly<{
|
||||
resourceId: string;
|
||||
title: string;
|
||||
createdAtLabel: string | null;
|
||||
createdAt: string | null;
|
||||
optimistic?: boolean;
|
||||
}>;
|
||||
|
||||
@@ -44,14 +44,10 @@ export function mapReferenceOperation(
|
||||
|
||||
export function toReferenceView(
|
||||
resource: ReferenceResource,
|
||||
formatDate: (value: Date) => string = (value) =>
|
||||
new Intl.DateTimeFormat("ko-KR").format(value),
|
||||
): ReferenceResourceView {
|
||||
return Object.freeze({
|
||||
resourceId: resource.id,
|
||||
title: resource.displayName,
|
||||
createdAtLabel: resource.createdAt
|
||||
? formatDate(new Date(resource.createdAt))
|
||||
: null,
|
||||
createdAt: resource.createdAt,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user