第一步:引入附件xdate.js (下载地址https://novaui.googlecode.com/svn-history/r40/trunk/novaUI/source/plugin/xdate.js或者进入主页https://code.google.com/p/novaui/source/browse/trunk/novaUI/source/plugin/xdate.js?r=40&spec=svn41,选择点击View raw file即可)
第二步:编写如下代码
var firstDate = new Date();
firstDate.setDate(1); //第一天
var endDate = new Date(firstDate);
endDate.setMonth(firstDate.getMonth()+1);
endDate.setDate(0);
alert("第一天:"+new XDate(firstDate).toString('yyyy-MM-dd')+" 最后一天:"+new XDate(endDate).toString('yyyy-MM-dd'));
完成上面两步就可以使用了(本文参考自互联网)