iamkun / iamkun/dayjs

Relative time in weeks

Open
#2,219 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Ability to get "weeks" from relative time plugin.
It would be nice, possibly optional, to be able to get "weeks" if relative time if between week and month.

**Expected behavior**
If relative time is used like `fromNow`, and the result is at least 7 days but shorter than a month, then return string like `2 weeks ago`

**Information**
- Day.js Version 1.11.7
- OS: Windows 11
- Browser Edge108.0.1462.76
- Time zone: GTM-06:00 DST

Contributor guide

Open the contributing guide

Research direction

The issue points to the relative time plugin and its fromNow behavior; start there and inspect how intervals between seven days and a month are currently selected. Done means that a value such as two weeks in that range can return "2 weeks ago," with the optional behavior resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.