iamkun / iamkun/dayjs

dayjs().format() returning future dates

Open
#2,663 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
48.7k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When calling dayjs().format(), the function occasionally returns a date that is a few days ahead of the current date. While the hours, minutes, and seconds remain consistent, the date itself is unstable. For example, on 2024-04-12T14:09:58Z, a client request was made to the API with a request body of 2024-04-15T16:09:58+02:00, showing the date as three days in the future.

Expected behavior
The dayjs().format() function should return the client's current date and time accurately, without any discrepancies.

Information

  • Day.js Version: ^1.11.9
  • OS: Android K
  • Browser: Chrome
  • Time zone: central european summer time UTC +2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified. Start by reproducing dayjs().format() with the reported Android, Chrome, and UTC+2 environment and compare the client date with the formatted result; done means the reported future-date discrepancy is explained and corrected, with coverage for the failing case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.