简体   繁体   中英

Moment js giving incorrect week

Here's my javascript

dt = moment("2016-01-01");
console.log(dt.week());

This gives week as 1

but when I refer to bootstrap calendar then it shows week as 53 of last year

在此处输入图片说明

can someone tell which is correct moment or bootstrap calendar? Also why?

PS - datepicker I am using is ui.bootstrap.datepicker from https://angular-ui.github.io/bootstrap/

经过一番谷歌搜索,我发现在我的情况下使用isoWeek()给出了正确的周数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM