Poor documentation or bug with local time display as string
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
`console.log(dayjs())`
...
$M
$W
$d: Tue Nov 30 2021 19:17:28 GMT+0530 (India Standard Time)
$m
...
`console.log(dayjs().toString())`
Tue, 30 Nov 2021 13:47:28 GMT
Huh? Calling [Now](https://day.js.org/docs/en/parse/now) shows local time, and calling [As String](https://day.js.org/docs/en/display/as-string) on Now mysteriously turns it into GMT.
So how is one supposed to get a string of the local time?
Contributor guide
Research direction
Start with the linked Now and As String documentation pages and reproduce both console.log examples in a local Day.js setup. Trace the documented behavior of toString and local-time formatting, then update the relevant documentation or add a focused regression test so the expected local-time string behavior is explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100