获取年季度, 1月份为去年及四季度,后面每季度的第一月显示为当年+上季度
export function getYearQuarter() {
const acquireYear = new Date().getFullYear()
const currentMonth = new Date().getMonth() + 1;
const normalQuarter = Math.floor((currentMonth % 3 == 0 ? (currentMonth / 3) : (currentMonth / 3 + 1))); // 其它月份
let quarter = {
'1' : `${acquireYear - 1}04`,
'4' : `${acquireYear}01`,
'7' : `${acquireYear}02`,
'10' : `${acquireYear}03`,
'default' : `${acquireYear}0${normalQuarter}`
}
return quarter[currentMonth] || quarter['default']
}