Skip to content

Commit

Permalink
updated invalid date
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed Feb 6, 2024
1 parent a6edbd4 commit 793327e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion packages/builder/src/components/grants/ApplicationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function ApplicationCard({
);

const isDirectRound = payoutStrategy === ROUND_PAYOUT_DIRECT;
console.log("===> props application", round?.applicationsEndTime);

return {
round,
Expand All @@ -60,7 +61,8 @@ export default function ApplicationCard({
props.round && (
<>
{formatDateFromSecs(props.round?.applicationsStartTime!)} -{" "}
{!isInfinite(Number(props.round?.applicationsEndTime!))
{!isInfinite(Number(props.round?.applicationsEndTime!)) &&
props.round?.applicationsEndTime
? formatDateFromSecs(props.round?.applicationsEndTime!)
: "No End Date"}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export default function RoundListItem({
roundData && (
<>
{formatDateFromSecs(roundData.applicationsStartTime)} -{" "}
{!isInfinite(roundData.applicationsEndTime)
{!isInfinite(roundData.applicationsEndTime) &&
roundData.applicationsEndTime
? formatDateFromSecs(roundData.applicationsEndTime)
: "No End Date"}
</>
Expand Down
7 changes: 5 additions & 2 deletions packages/builder/src/components/rounds/Apply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function Apply() {
: undefined;
const showErrorModal =
applicationError && applicationStatus === ApplicationStatus.Error;
console.log("===> props application", round?.applicationsEndTime);

return {
roundState,
Expand Down Expand Up @@ -249,7 +250,8 @@ function Apply() {
<p className="font-semibold mt-4">Application Period:</p>
<p>
{formatDate(props.round.applicationsStartTime * 1000)} -{" "}
{isInfinite(props.round.applicationsEndTime)
{isInfinite(props.round.applicationsEndTime) ||
!props.round.applicationsEndTime
? "No End Date"
: formatDate(props.round.applicationsEndTime * 1000)}
</p>
Expand All @@ -258,7 +260,8 @@ function Apply() {
<p className="font-semibold mt-4">Round Dates:</p>
<p>
{formatDate(props.round.roundStartTime * 1000)} -{" "}
{isInfinite(props.round.applicationsEndTime)
{isInfinite(props.round.applicationsEndTime) ||
!props.round.applicationsEndTime
? "No End Date"
: formatDate(props.round.roundEndTime * 1000)}
</p>
Expand Down
5 changes: 3 additions & 2 deletions packages/builder/src/components/rounds/Show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ function ShowRound() {
roundData && (
<>
{formatTimeUTC(roundData.applicationsStartTime)} -{" "}
{isInfinite(roundData.applicationsEndTime)
{isInfinite(roundData.applicationsEndTime) ||
!roundData.applicationsEndTime
? "No End Date"
: formatTimeUTC(roundData.applicationsEndTime)}
</>
Expand All @@ -191,7 +192,7 @@ function ShowRound() {
roundData && (
<>
{formatTimeUTC(roundData.roundStartTime)} -{" "}
{isInfinite(roundData.roundEndTime)
{isInfinite(roundData.roundEndTime) || !roundData.roundEndTime
? "No End Date"
: formatTimeUTC(roundData.roundEndTime)}
{}
Expand Down
6 changes: 4 additions & 2 deletions packages/builder/src/components/rounds/ViewApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ function ViewApplication() {
<p className="font-semibold mt-4">Application Period:</p>
<p>
{formatDate(props.round.applicationsStartTime * 1000)} -{" "}
{isInfinite(props.round.applicationsEndTime)
{isInfinite(props.round.applicationsEndTime) ||
!props.round.applicationsEndTime
? "No End Date"
: formatDate(props.round.applicationsEndTime * 1000)}
</p>
Expand All @@ -204,7 +205,8 @@ function ViewApplication() {
<p className="font-semibold mt-4">Round Dates:</p>
<p>
{formatDate(props.round.roundStartTime * 1000)} -{" "}
{isInfinite(props.round.applicationsEndTime)
{isInfinite(props.round.applicationsEndTime) ||
!props.round.applicationsEndTime
? "No End Date"
: formatDate(props.round.roundEndTime * 1000)}
</p>
Expand Down

0 comments on commit 793327e

Please sign in to comment.