Skip to content

Commit 20d49de

Browse files
author
manfredsteger
committed
Display correct slot descriptions in organization polls
Fix an issue where organization poll slot descriptions were replaced by dates in the voting interface. Update `FormattedOptionText` to always display the provided `text` as the slot title and refactor date formatting to use the current language. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1117a91e-7ac6-4005-bde2-487c64d5789f Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: bc13bf85-3d07-473b-aac6-6422c5acd37a Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/afc5b6d1-cfc6-4564-802f-661c3d73f96b/1117a91e-7ac6-4005-bde2-487c64d5789f/76IdNCC
1 parent ba6fc68 commit 20d49de

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

client/src/components/OrganizationSlotVoting.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ import { Progress } from '@/components/ui/progress';
88
import { Badge } from '@/components/ui/badge';
99
import { Users, Clock, Check, MessageCircle } from 'lucide-react';
1010
import { type PollOption } from '@shared/schema';
11-
import { formatScheduleOptionWithWeekday } from '@/lib/utils';
1211

13-
function FormattedOptionText({ text, startTime, locale = 'en' }: { text: string; startTime?: Date | string | null; locale?: string }) {
14-
const startTimeStr = startTime instanceof Date ? startTime.toISOString() : startTime;
15-
const formatted = formatScheduleOptionWithWeekday(text, startTimeStr, locale);
16-
if (formatted.isSchedule) {
17-
return <><span className="font-bold">{formatted.dateWithWeekday}</span> {formatted.time}</>;
18-
}
12+
function FormattedOptionText({ text }: { text: string; startTime?: Date | string | null; locale?: string }) {
1913
return <>{text}</>;
2014
}
2115

@@ -117,7 +111,7 @@ export function OrganizationSlotVoting({
117111
if (!dateVal) return null;
118112
try {
119113
const date = typeof dateVal === 'string' ? new Date(dateVal) : dateVal;
120-
return date.toLocaleString('de-DE', {
114+
return date.toLocaleString(i18n.language === 'de' ? 'de-DE' : 'en-US', {
121115
weekday: 'short',
122116
day: '2-digit',
123117
month: '2-digit',

0 commit comments

Comments
 (0)