เพิ่มข้อมูล "อายุราชการ (กทม.)" #2285
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s
This commit is contained in:
parent
5b726e69c8
commit
1696890f74
3 changed files with 10 additions and 2 deletions
|
|
@ -44,7 +44,7 @@ export function calculateAge(start: Date, end = new Date()) {
|
|||
return { year, month, day };
|
||||
}
|
||||
|
||||
export async function calculateGovAge(profileId: string, type: string) {
|
||||
export async function calculateGovAge(profileId: string, type: string, bkk?: boolean) {
|
||||
// type = OFFICER , EMPLOYEE
|
||||
const isEmployee = type === "EMPLOYEE";
|
||||
|
||||
|
|
@ -107,7 +107,9 @@ export async function calculateGovAge(profileId: string, type: string) {
|
|||
});
|
||||
}
|
||||
// const firstStartDate = new Date(records[0].date);
|
||||
const firstStartDate = profile?.dateAppoint ? profile?.dateAppoint : new Date();
|
||||
const firstStartDate = !bkk
|
||||
? profile?.dateAppoint ? profile?.dateAppoint : new Date()
|
||||
: profile?.dateStart ? profile?.dateStart : new Date() ;
|
||||
const firstEndDate = endDateFristRec ? new Date(endDateFristRec.dateGovernment) : new Date();
|
||||
|
||||
// console.log("firstStartDate1", firstStartDate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue