[英]Showing the last thursday of the current month with DateJS
You may want to use the moveToLastDayOfMonth() method as follows: 您可能要使用moveToLastDayOfMonth()方法,如下所示:
var lastThuOfThisMonth;
Date.today().moveToLastDayOfMonth().last().is().thursday() ?
lastThuOfThisMonth = Date.today().moveToLastDayOfMonth().last() :
lastThuOfThisMonth = Date.today().moveToLastDayOfMonth().last().thursday();
Just tried it in Firebug. 刚刚在Firebug中尝试过。 I also checked for
last().sunday()
since this month ends with a Sunday. 我还检查了
last().sunday()
因为这个月以星期日结束。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.