fix:add function calculateFiscalYear
This commit is contained in:
parent
4cc8fb0c1c
commit
c966e1d961
3 changed files with 14 additions and 2 deletions
10
src/utils/function.ts
Normal file
10
src/utils/function.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