+ return
{children}
- {!isNaN(since.getTime()) && {since.toDateString()}}
- ;
+ {!isNaN(since.getTime()) && (
+
+ {formatter.format(since)}
+
+ )}
+
;
})
});
diff --git a/src/plugins/sortFriendRequests/styles.css b/src/plugins/sortFriendRequests/styles.css
new file mode 100644
index 00000000..98be9da7
--- /dev/null
+++ b/src/plugins/sortFriendRequests/styles.css
@@ -0,0 +1,18 @@
+.vc-sortFriendRequests-wrapper {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ margin-right: 0.5em;
+}
+
+.vc-sortFriendRequests-tooltip {
+ max-width: none;
+ white-space: nowrap;
+}
+
+.vc-sortFriendRequests-date {
+ color: var(--text-muted);
+ font-family: var(--font-code);
+}
diff --git a/src/webpack/common/types/utils.d.ts b/src/webpack/common/types/utils.d.ts
index 00e3f4a0..de1ce182 100644
--- a/src/webpack/common/types/utils.d.ts
+++ b/src/webpack/common/types/utils.d.ts
@@ -324,3 +324,10 @@ export interface DisplayProfileUtils {
getDisplayProfile(userId: string, guildId?: string, customStores?: any): DisplayProfile | null;
useDisplayProfile(userId: string, guildId?: string, customStores?: any): DisplayProfile | null;
}
+
+export interface DateUtils {
+ isSameDay(date1: Date, date2: Date): boolean;
+ calendarFormat(date: Date): string;
+ dateFormat(date: Date, format: string): string;
+ diffAsUnits(start: Date, end: Date, stopAtOneSecond?: boolean): Record<"days" | "hours" | "minutes" | "seconds", number>;
+}
diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts
index 3699300b..1bdf236a 100644
--- a/src/webpack/common/utils.ts
+++ b/src/webpack/common/utils.ts
@@ -199,3 +199,10 @@ export const DisplayProfileUtils: t.DisplayProfileUtils = mapMangledModuleLazy(/
getDisplayProfile: filters.byCode(".getGuildMemberProfile("),
useDisplayProfile: filters.byCode(/\[\i\.\i,\i\.\i],\(\)=>/)
});
+
+export const DateUtils: t.DateUtils = mapMangledModuleLazy("millisecondsInUnit:", {
+ calendarFormat: filters.byCode("sameElse"),
+ dateFormat: filters.byCode('":'),
+ isSameDay: filters.byCode("Math.abs(+"),
+ diffAsUnits: filters.byCode("days:0", "millisecondsInUnit")
+});