Spaces:
Running
Running
Display all deadlines in local time zone
Browse files
src/components/ConferenceDialog.tsx
CHANGED
|
@@ -192,6 +192,23 @@ END:VCALENDAR`;
|
|
| 192 |
);
|
| 193 |
};
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
return (
|
| 196 |
<Dialog open={open} onOpenChange={onOpenChange}>
|
| 197 |
<DialogContent
|
|
@@ -233,50 +250,30 @@ END:VCALENDAR`;
|
|
| 233 |
<div className="text-sm text-gray-500 space-y-2">
|
| 234 |
{conference.abstract_deadline && (
|
| 235 |
<div className="bg-gray-100 rounded-md p-2">
|
| 236 |
-
<p>Abstract: {
|
| 237 |
-
? format(parseISO(conference.abstract_deadline), "MMMM d, yyyy")
|
| 238 |
-
: conference.abstract_deadline}
|
| 239 |
-
</p>
|
| 240 |
</div>
|
| 241 |
)}
|
| 242 |
<div className="bg-gray-100 rounded-md p-2">
|
| 243 |
-
<p>Submission: {
|
| 244 |
-
? format(parseISO(conference.deadline), "MMMM d, yyyy")
|
| 245 |
-
: conference.deadline}
|
| 246 |
-
</p>
|
| 247 |
</div>
|
| 248 |
{conference.commitment_deadline && (
|
| 249 |
<div className="bg-gray-100 rounded-md p-2">
|
| 250 |
-
<p>Commitment: {
|
| 251 |
-
? format(parseISO(conference.commitment_deadline), "MMMM d, yyyy")
|
| 252 |
-
: conference.commitment_deadline}
|
| 253 |
-
</p>
|
| 254 |
</div>
|
| 255 |
)}
|
| 256 |
{conference.review_release_date && (
|
| 257 |
<div className="bg-gray-100 rounded-md p-2">
|
| 258 |
-
<p>Reviews Released: {
|
| 259 |
-
? format(parseISO(conference.review_release_date), "MMMM d, yyyy")
|
| 260 |
-
: conference.review_release_date}
|
| 261 |
-
</p>
|
| 262 |
</div>
|
| 263 |
)}
|
| 264 |
{(conference.rebuttal_period_start || conference.rebuttal_period_end) && (
|
| 265 |
<div className="bg-gray-100 rounded-md p-2">
|
| 266 |
-
<p>Rebuttal Period: {conference.rebuttal_period_start
|
| 267 |
-
? format(parseISO(conference.rebuttal_period_start), "MMMM d, yyyy")
|
| 268 |
-
: conference.rebuttal_period_start} - {conference.rebuttal_period_end && isValid(parseISO(conference.rebuttal_period_end))
|
| 269 |
-
? format(parseISO(conference.rebuttal_period_end), "MMMM d, yyyy")
|
| 270 |
-
: conference.rebuttal_period_end}
|
| 271 |
-
</p>
|
| 272 |
</div>
|
| 273 |
)}
|
| 274 |
{conference.final_decision_date && (
|
| 275 |
<div className="bg-gray-100 rounded-md p-2">
|
| 276 |
-
<p>Final Decision: {
|
| 277 |
-
? format(parseISO(conference.final_decision_date), "MMMM d, yyyy")
|
| 278 |
-
: conference.final_decision_date}
|
| 279 |
-
</p>
|
| 280 |
</div>
|
| 281 |
)}
|
| 282 |
</div>
|
|
|
|
| 192 |
);
|
| 193 |
};
|
| 194 |
|
| 195 |
+
// Add these new functions to handle consistent date conversion
|
| 196 |
+
const getLocalDeadline = (dateString: string | undefined) => {
|
| 197 |
+
if (!dateString || dateString === 'TBD') return null;
|
| 198 |
+
return getDeadlineInLocalTime(dateString, conference.timezone);
|
| 199 |
+
};
|
| 200 |
+
|
| 201 |
+
// Format any deadline date consistently
|
| 202 |
+
const formatDeadlineDate = (dateString: string | undefined) => {
|
| 203 |
+
if (!dateString || dateString === 'TBD') return dateString || 'TBD';
|
| 204 |
+
|
| 205 |
+
const localDate = getLocalDeadline(dateString);
|
| 206 |
+
if (!localDate || !isValid(localDate)) return dateString;
|
| 207 |
+
|
| 208 |
+
const localTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
| 209 |
+
return `${format(localDate, "MMMM d, yyyy")} (${localTZ})`;
|
| 210 |
+
};
|
| 211 |
+
|
| 212 |
return (
|
| 213 |
<Dialog open={open} onOpenChange={onOpenChange}>
|
| 214 |
<DialogContent
|
|
|
|
| 250 |
<div className="text-sm text-gray-500 space-y-2">
|
| 251 |
{conference.abstract_deadline && (
|
| 252 |
<div className="bg-gray-100 rounded-md p-2">
|
| 253 |
+
<p>Abstract: {formatDeadlineDate(conference.abstract_deadline)}</p>
|
|
|
|
|
|
|
|
|
|
| 254 |
</div>
|
| 255 |
)}
|
| 256 |
<div className="bg-gray-100 rounded-md p-2">
|
| 257 |
+
<p>Submission: {formatDeadlineDate(conference.deadline)}</p>
|
|
|
|
|
|
|
|
|
|
| 258 |
</div>
|
| 259 |
{conference.commitment_deadline && (
|
| 260 |
<div className="bg-gray-100 rounded-md p-2">
|
| 261 |
+
<p>Commitment: {formatDeadlineDate(conference.commitment_deadline)}</p>
|
|
|
|
|
|
|
|
|
|
| 262 |
</div>
|
| 263 |
)}
|
| 264 |
{conference.review_release_date && (
|
| 265 |
<div className="bg-gray-100 rounded-md p-2">
|
| 266 |
+
<p>Reviews Released: {formatDeadlineDate(conference.review_release_date)}</p>
|
|
|
|
|
|
|
|
|
|
| 267 |
</div>
|
| 268 |
)}
|
| 269 |
{(conference.rebuttal_period_start || conference.rebuttal_period_end) && (
|
| 270 |
<div className="bg-gray-100 rounded-md p-2">
|
| 271 |
+
<p>Rebuttal Period: {formatDeadlineDate(conference.rebuttal_period_start)} - {formatDeadlineDate(conference.rebuttal_period_end)}</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
</div>
|
| 273 |
)}
|
| 274 |
{conference.final_decision_date && (
|
| 275 |
<div className="bg-gray-100 rounded-md p-2">
|
| 276 |
+
<p>Final Decision: {formatDeadlineDate(conference.final_decision_date)}</p>
|
|
|
|
|
|
|
|
|
|
| 277 |
</div>
|
| 278 |
)}
|
| 279 |
</div>
|