leerob / site

My site built with Next.js, Tailwind, and Vercel.
https://leerob.com
7.2k stars 1.39k forks source link

Update `formatDate` logic. #690

Closed vinaykulk621 closed 7 months ago

vinaykulk621 commented 10 months ago

Here in this blog post it is being showed that it was published last year, But it was just 2 months ago.

image

This PR introduces the new logic where it accurately shows the duration like how many days, weeks, months or years.

vercel[bot] commented 10 months ago

@vinaykulk621 is attempting to deploy a commit to the leerob-site Team on Vercel.

A member of the Team first needs to authorize it.

vinaykulk621 commented 10 months ago

This blog post was published in december, with the old logic it would show it as 1y ago. With the new logic it would show it as 1mo ago.

This PR will make the dates look like this.

Except for the font and styling of the Date, Just look at the formatting. image

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 1:27pm
leerob commented 10 months ago

CleanShot 2024-01-27 at 10 10 30@2x

vinaykulk621 commented 10 months ago

@leerob Fixed it.

vinaykulk621 commented 10 months ago

There was a mistake in converting it into locale string. Verified it on local machine 👍🏻.

vinaykulk621 commented 7 months ago

Hey @leerob, any plan on merging this>?