Skip to content

Handle missing dateOfLaunch by displaying dash placeholder [Fixes #16305]#16443

Merged
wackerow merged 2 commits into
ethereum:devfrom
clacladev:fix/app-explorer-nan-info
Oct 7, 2025
Merged

Handle missing dateOfLaunch by displaying dash placeholder [Fixes #16305]#16443
wackerow merged 2 commits into
ethereum:devfrom
clacladev:fix/app-explorer-nan-info

Conversation

@clacladev
Copy link
Copy Markdown
Contributor

@clacladev clacladev commented Oct 6, 2025

Description

Many Apps in the App Explorer are missing the Founding date, but no check is done, so it's manipulated and displayed as NaN.

Apps where I can reproduce the issue:
https://ethereum.org/apps/eternal-ai/
https://ethereum.org/apps/virtuals/
https://ethereum.org/apps/human-passport/
https://ethereum.org/apps/zk-open-passport/
https://ethereum.org/apps/zk-open-passport/

Solution

I am going to treat the missing Founding Data the same way Last Update Data is treated: displaying a - (dash) as a placeholder.

## Problem and Solution Demo

Before:
Screenshot 2025-10-06 at 15 51 55

After:
Screenshot 2025-10-06 at 15 57 46

## How to test

Related Issue

Issue: #16305 (comment)

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 6, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit b1f39df
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/68e537432e38ef00080df554
😎 Deploy Preview https://deploy-preview-16443--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines +330 to +332
{app.dateOfLaunch
? new Date(app.dateOfLaunch).getFullYear()
: "—"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall... slight request though to make this a touch more robust:

We have an isValidDate helper function inside src/lib/utils/date.ts which would not only check if something is "falsy" like this solution, but also makes sure that any string/number we pass to the Date constructor will not evaluate to NaN.

This function is already being used within this file, so it's already imported and ready for use. Would suggest a pattern similar to the getTimeAgo function above on lines 120-121.

  const getTimeAgo = (dateString: string) => {
    if (!dateString || !isValidDate(dateString)) return "—"

So we could add something like this immediately below that function:

  const getDisplayYear = (dateString: string) => {
    if (!isValidDate(dateString)) return "—"
    return new Date(app.dateOfLaunch).getFullYear()
  }

and then update the lines here with:

Suggested change
{app.dateOfLaunch
? new Date(app.dateOfLaunch).getFullYear()
: "—"}
{getDisplayYear(app.dateOfLaunch)}

(Side note, we wouldn't need the !dateString || check shown in getTimeAgo since TypeScript constraints force that this must be a string, and an empty string passed to isValidDate("") will properly evaluate to false)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wackerow you're absolutely right. I should have read better the code to see there was a utility function and a pattern already established.

Anyway, I implemented the suggested changes and it still works as intended. Thanks for the guidance, next time I try to waste less of your time ;)

Screenshot 2025-10-07 at 16 51 33

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah didn't waste anyones time, happy to help, thanks @clacladev!

Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks again =)

@wackerow wackerow merged commit 7bd3693 into ethereum:dev Oct 7, 2025
11 checks passed
@wackerow
Copy link
Copy Markdown
Member

wackerow commented Oct 7, 2025

@all-contributors please add @clacladev for bug fix

@allcontributors
Copy link
Copy Markdown
Contributor

@wackerow

I've put up a pull request to add @clacladev! 🎉

@clacladev
Copy link
Copy Markdown
Contributor Author

Happy to help @wackerow
Let me know if I can help with more tickets!

This was referenced Oct 9, 2025
This was referenced Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants