[英]How to get start and end Datetime of ISO 8601 week in JavaScript?
If I have the Year (say 2013) and the ISO week (say 35), how do I get the Starting and Ending DateTime in pure JavaScript? 如果我有年份(比如2013)和ISO周(比如35),我如何在纯JavaScript中获得开始和结束日期时间?
Is there any specific Library for dealing with DateTime in JavaScript? 是否有任何特定的库来处理JavaScript中的DateTime?
As far as a library, there is http://www.datejs.com/ . 至于图书馆,有http://www.datejs.com/ 。 Or http://phpjs.org/functions/date/ .
或http://phpjs.org/functions/date/ 。
Try 尝试
var date = new Date('01 Jan ' + year);
date.setDate(35 * 7);
date.setDate(date.getDate() - date.getDay()) //it will give the start of the week
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.