iamkun / iamkun/dayjs

dayjs对monthsShort方法的参数重载缺少了数字的支持

Open
#1,782 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
dayjs的dayjs.monthsShort 方法和moment的有一点区别。moment支持从一个数字返回月份,这块逻辑能补上吗

比如moment.monthsShort(1) === '2月',dayjs.monthsShort(1) === '1月2月3月......11月12月'

如下图是moment的api
image

image

Expected behavior
api缺失

Information

  • Day.js Version [e.g. v1.0.0]
  • OS: [e.g. iOS]
  • Browser [e.g. chrome 62]
  • Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]

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

Start at the dayjs.monthsShort API and compare its current argument handling with Moment's numeric behavior. Verify the expected result for a numeric month argument and ensure the no-argument behavior remains intact; done means a numeric input returns the corresponding abbreviated month instead of the full month list.

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.