>
)}
- {timestamp !== null &&
{timestamp}
}
+ {timestamp !== null && (
+
+ {timestamp.toLocaleDateString(undefined, {
+ month: 'short',
+ year: 'numeric',
+ })}
+
+ )}
{showAddToList && (
@@ -317,7 +324,7 @@ export default function BaseQuestionCard({
{cardContent}
diff --git a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx
index 209cc1ad..c69cf81c 100644
--- a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx
+++ b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx
@@ -221,12 +221,7 @@ export default function ContributeQuestionForm({
createEncounterButtonText="Yes, this is my question"
questionId={question.id}
roles={roleCounts}
- timestamp={
- question.seenAt.toLocaleDateString(undefined, {
- month: 'short',
- year: 'numeric',
- }) ?? null
- }
+ timestamp={question.seenAt}
type={question.type}
onReceivedSubmit={async (data) => {
await addEncounterAsync({
diff --git a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
index 9fdee125..5baee8fe 100644
--- a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
+++ b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
@@ -210,10 +210,7 @@ export default function QuestionPage() {
questionId={question.id}
receivedCount={undefined}
roles={relabeledAggregatedEncounters?.roleCounts ?? {}}
- timestamp={question.seenAt.toLocaleDateString(undefined, {
- month: 'short',
- year: 'numeric',
- })}
+ timestamp={question.seenAt}
upvoteCount={question.numVotes}
onReceivedSubmit={async (data) => {
await addEncounterAsync({
diff --git a/apps/portal/src/pages/questions/browse.tsx b/apps/portal/src/pages/questions/browse.tsx
index 87eaea27..9a4b6d31 100644
--- a/apps/portal/src/pages/questions/browse.tsx
+++ b/apps/portal/src/pages/questions/browse.tsx
@@ -558,13 +558,9 @@ export default function QuestionsBrowsePage() {
questionId={question.id}
receivedCount={question.receivedCount}
roles={roleCounts}
- timestamp={question.seenAt.toLocaleDateString(
- undefined,
- {
- month: 'short',
- year: 'numeric',
- },
- )}
+ timestamp={
+ question.aggregatedQuestionEncounters.latestSeenAt
+ }
type={question.type}
upvoteCount={question.numVotes}
/>
diff --git a/apps/portal/src/pages/questions/lists.tsx b/apps/portal/src/pages/questions/lists.tsx
index 5be1257c..99539de7 100644
--- a/apps/portal/src/pages/questions/lists.tsx
+++ b/apps/portal/src/pages/questions/lists.tsx
@@ -220,13 +220,7 @@ export default function ListPage() {
questionId={question.id}
receivedCount={question.receivedCount}
roles={roleCounts}
- timestamp={question.seenAt.toLocaleDateString(
- undefined,
- {
- month: 'short',
- year: 'numeric',
- },
- )}
+ timestamp={question.seenAt}
type={question.type}
onDelete={() => {
deleteQuestionEntry({ id: entryId });
diff --git a/apps/portal/src/utils/questions/constants.ts b/apps/portal/src/utils/questions/constants.ts
index b1746821..789e61e9 100644
--- a/apps/portal/src/utils/questions/constants.ts
+++ b/apps/portal/src/utils/questions/constants.ts
@@ -69,38 +69,38 @@ export const QUESTION_AGES: FilterChoices = [
] as const;
export const SORT_ORDERS = [
- {
- label: 'Ascending',
- value: SortOrder.ASC,
- },
{
label: 'Descending',
value: SortOrder.DESC,
},
+ {
+ label: 'Ascending',
+ value: SortOrder.ASC,
+ },
];
export const SORT_TYPES = [
{
- label: 'New',
- value: SortType.NEW,
+ label: 'Upvotes',
+ value: SortType.TOP,
},
{
- label: 'Top',
- value: SortType.TOP,
+ label: 'Date',
+ value: SortType.NEW,
},
];
export const QUESTION_SORT_TYPES = [
{
- label: 'New',
- value: SortType.NEW,
+ label: 'Upvotes',
+ value: SortType.TOP,
},
{
- label: 'Top',
- value: SortType.TOP,
+ label: 'Age',
+ value: SortType.NEW,
},
{
- label: 'Encounters',
+ label: 'Received',
value: SortType.ENCOUNTERS,
},
];