欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

匹配报告期解析

程序员文章站 2022-06-26 09:21:17
function matchreport(report) { var themouth = new date(report).getmonth() + 1; theyear =...

function matchreport(report) {

var themouth = new date(report).getmonth() + 1;

theyear = report.split("-")[0];

switch (themouth) {

case 3:

return theyear + "一季报";

case 6:

return theyear + "中报";

case 9:

return theyear + "三季报";

case 12:

return theyear + "年报";

default:

return report;

}

}