fix:add function calculateFiscalYear
This commit is contained in:
parent
70be19b5c4
commit
7877f26ac6
47 changed files with 131 additions and 68 deletions
|
|
@ -17,3 +17,14 @@ export async function updateCurrentPage(
|
|||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* คำนวณปีงบประมาณ
|
||||
*
|
||||
* @param date วันที่ปัจจุบัน
|
||||
* @returns ปีงบประมาณ
|
||||
*/
|
||||
export function calculateFiscalYear(date: Date) {
|
||||
const month = date.getMonth() + 1;
|
||||
return month >= 10 ? date.getFullYear() + 1 : date.getFullYear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue