利用FireBug,生成当月工作时间表

做工作中的考勤表,需要生成当月的工作日期, 排除 周六日 。

相比使用 脚本,会更方便一些,不用编译,常用的脚本: SQL , Js 。

经常用 Chrome,相比之下 fireBug 更轻量。但不能换行。(换行的话,需要声明为全局变量)

var now = new Date() ;  
var lastDay = new Date( new Date( now.getFullYear() +"/" + (now.getMonth()+2) + "/1" ).getTime() - 1000*60*60*24 ).getDate() ;
for(var i= 1 ;i<= lastDay ;i++) {
  var dayStr = now.getFullYear() + "-" + ( now.getMonth() + 1 ) + "-" + i ;
  var day = new Date( dayStr) ;
  if ( day.getDay() == 0 || day.getDay() == 6 ) continue ;
  else console.log( dayStr) ;
}

即在工作台上打印出当月工作日期表。

alarm   作者:NewSea     出处:http://newsea.cnblogs.com/    QQ,MSN:iamnewsea@hotmail.com

  如无特别标记说明,均为NewSea原创,版权私有,翻载必纠。欢迎交流,转载,但要在页面明显位置给出原文连接。谢谢。
原文地址:https://www.cnblogs.com/newsea/p/2720322.html