Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
technoph1le merged 1 commit into quicksnip-dev:main from Yugveer06:main
Dec 29, 2024

Conversation

Copy link
Contributor

@Yugveer06 Yugveer06 commented Dec 29, 2024

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
edited
Loading

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
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
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /