moment("20-52", "YY-ww").add(1, "week").format("YY-ww");
结果是20-01
,但我希望它是21-01
有什么想法吗?这是一个bug,还是我做错了?
发布于 2021-05-01 00:07:55
您必须使用ISO week of years (WW
),使用小写的ww
moment获取问题周的最后一天的周。
const ue = moment("20-52", "YY-WW", true).add(1, "week").format("YY-WW");
console.log(ue);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
https://stackoverflow.com/questions/67128098
复制相似问题