fix:add function calculateFiscalYear
This commit is contained in:
parent
72aa6f44ac
commit
27280c393f
5 changed files with 18 additions and 4 deletions
10
src/utils/functions.ts
Normal file
10
src/utils/functions.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* คำนวณปีงบประมาณ
|
||||
*
|
||||
* @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