我正在尝试使用momentjs从一年中获取每周的计数,如下所示,
let now = moment("01/06/2018");
var weekresult = now.week();
alert(weekresult);
var weekinYear = now.weeksInYear();
alert(weekinYear);
Uncaught TypeError: now.weeksInYear is not a function
运行于Jsfiddle
答案 0 :(得分:1)
正如docs所说,isoWeeksInYear()
自版本UPDATE ot
set ot.Delivered = dt.Delivered
FROM OverallTable ot INNER JOIN
DeliveredTable dt
ON dt.Invoice = ot.Invoice AND
dt.Product = ot.Product;
起可用,而您正在链接的提琴中使用时刻2.6.0+
时。
此外,由于2.2.1
既不符合ISO 8601也不符合RFC 2822,因此您必须使用moment(String, String)
而不是moment(String)
。
以下是最新版本的实时示例:
"01/06/2018"
let now = moment("01/06/2018", "DD/MM/YYYY");
var weekresult = now.week();
console.log(weekresult);
var weekinYear = now.weeksInYear();
console.log(weekinYear);