从日期获取月份周数 (2022-02-28T10:00:53.393Z) -> 5
如何从像 moment("2022-02-28T10:00:53.393Z")
这样的日期获取周数应该返回 5。 我知道 week()
但它会从年初返回周数,就像它会根据日期给出 11
一样。 我需要周号。从 2 月第 1 周或 2 月第 5 周等月份开始
How to get week no from a date like moment("2022-02-28T10:00:53.393Z")
should return 5.
I know about week()
but that return week no from start of year like it will give 11
based on the date.
I need the week no. from month like week 1 of February or week 5 of February
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

这是这个问题的解决方案
Here is the solution for this