Skip to content

Add Relative Time Formatter Utility Function #6

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

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

Yugveer06
Copy link
Contributor

This PR adds a new date utility function that formats dates into human-readable relative time strings.

Key Features:

  • Converts dates to "X time ago" or "in X time" format
  • Supports multiple time units (years, days, hours, minutes, seconds)
  • Handles both past and future dates
  • Returns "just now" for timestamps within last second
  • Includes usage examples

Example outputs:

  • Past date: "2 years ago"
  • Future date: "in 3 months"
  • Recent: "just now"

Copy link

netlify bot commented Dec 29, 2024

Deploy Preview for quicksnip ready!

Name Link
🔨 Latest commit 5b07e3c
🔍 Latest deploy log https://app.netlify.com/sites/quicksnip/deploys/6770f8d410a8ea00087aa9f7
😎 Deploy Preview https://deploy-preview-6--quicksnip.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.

@technoph1le technoph1le merged commit 74ead62 into quicksnip-dev:main Dec 29, 2024
4 checks passed
@technoph1le
Copy link
Collaborator

Hey, there! Thank you for the contribution 🙌

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