Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💅 show date only when it is defined #11085

Closed
wants to merge 1 commit into from
Closed

Conversation

vikiival
Copy link
Member

@vikiival vikiival commented Oct 6, 2024

Thank you for your contribution to the Koda - Generative Art Marketplace.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

I was trying to find out why do we have 'Invalid Date' on collections, as this info is passed from the server I do not see why is it failing.

This PR hides the date when date is undefined

> createdAt = '2024-08-01T11:09:48.000000Z'
'2024-08-01T11:09:48.000000Z'
> new Date(createdAt).toLocaleDateString()
'8/1/2024'
> new Date(undefined).toLocaleDateString()
'Invalid Date'

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

Screenshot 2024-10-06 at 13 42 53

Screenshot 2024-10-06 at 13 52 32

@vikiival vikiival requested a review from a team as a code owner October 6, 2024 11:57
@vikiival vikiival requested review from preschian and hassnian and removed request for a team October 6, 2024 11:57
Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit d63823e
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/67027b1bf6db9a00088c2fbd
😎 Deploy Preview https://deploy-preview-11085--koda-canary.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 site configuration.

Copy link

sonarqubecloud bot commented Oct 6, 2024

@vikiival
Copy link
Member Author

vikiival commented Oct 6, 2024

cc @preschian is it possible to 'repurge' cache or why is this happening?

Copy link

Deploying koda-art-prod with  Cloudflare Pages  Cloudflare Pages

Latest commit: d63823e
Status: ✅  Deploy successful!
Preview URL: https://ee350dca.kodaart-production.pages.dev
Branch Preview URL: https://fix-invalid-date.kodaart-production.pages.dev

View logs

@preschian
Copy link
Member

cc @preschian is it possible to 'repurge' cache or why is this happening?

purge from where? created at is from indexer:

const { data } = useQuery({
queryKey: ['collection-minimal', isAssetHub, collectionId],
queryFn: async () =>
collectionId.value
? (await useAsyncGraphql({
query: isAssetHub.value
? 'collectionByIdMinimalWithRoyalty'
: 'collectionByIdMinimal',
variables: variables.value,
clientId: client.value,
})).data.value
: null,
})

imo, would be better if we get it from oda-worker instead

@vikiival
Copy link
Member Author

vikiival commented Oct 7, 2024

Please observe screenshots above

@preschian
Copy link
Member

Please observe screenshots above

because it's not blocking request to render the component. please see code snippet above and the props here:

const createdAt = computed(() => props.collection?.createdAt)

@vikiival
Copy link
Member Author

vikiival commented Oct 7, 2024

So why is it invalid date then on prod and valid date on any other?

@preschian
Copy link
Member

So why is it invalid date then on prod and valid date on any other?

it was fixed here: #11039

@vikiival
Copy link
Member Author

vikiival commented Oct 7, 2024

Thanks

@vikiival vikiival closed this Oct 7, 2024
@vikiival vikiival deleted the fix/invalid-date branch October 7, 2024 16:30
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