fix format

This commit is contained in:
AdisakKanthawilang 2024-06-06 18:06:01 +07:00
parent 594371d23f
commit 8a624efe6f
2 changed files with 11 additions and 15 deletions

View file

@ -177,11 +177,11 @@ export class ProfileController extends Controller {
LastName: profile.lastName != null ? profile.lastName : "",
DateOfBirth:
profile.birthDate != null
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.birthDate))
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
: "",
DateRetire:
profile.dateRetire != null
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.dateRetire))
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
: "",
RegistrationAddress: Extension.ToThaiNumber(
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
@ -197,12 +197,12 @@ export class ProfileController extends Controller {
: "",
AppointText:
profile.dateAppoint != null
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.dateAppoint))
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
: "",
SalaryDate:
profile.profileSalary.length > 0 && profile.profileSalary[0].date != null
? Extension.ToThaiNumber(
Extension.ToThaiShortDate_perfixMonthYear(profile.profileSalary[0].date),
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
)
: "",
PositionName: profile.position != null ? profile.position : "",
@ -414,7 +414,7 @@ export class ProfileController extends Controller {
DisciplineYear:
Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString()) ?? null,
DisciplineDetail: item.detail ?? null,
RefNo: item.refCommandNo ?? null,
RefNo: Extension.ToThaiNumber(item.refCommandNo) ?? null,
}));
const educations = await this.educationRepository.find({
@ -448,6 +448,8 @@ export class ProfileController extends Controller {
"positionLevel",
"positionSalaryAmount",
"refCommandNo",
"amount",
"templateDoc",
],
where: { profileId: id },
});
@ -456,9 +458,9 @@ export class ProfileController extends Controller {
SalaryDate: Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.date)) ?? null,
Position: item.position ?? null,
PosNo: item.posNo ?? null,
Salary: "",
Salary: item.amount ?? null,
Rank: item.positionLevel ?? null,
RefAll: item.refCommandNo ?? null,
RefAll: Extension.ToThaiNumber(item.templateDoc) ?? null,
PositionType: item.positionType ?? null,
PositionLevel: item.positionLevel ?? null,
PositionAmount:

View file

@ -123,15 +123,9 @@ class Extension {
);
}
public static ToThaiShortDate_perfixMonthYear(value: Date) {
public static ToThaiShortDate_monthYear(value: Date) {
let yy = value.getFullYear() < 2400 ? value.getFullYear() + 543 : value.getFullYear();
return (
value.getDate() +
" เดือน " +
Extension.ToThaiShortMonth(value.getMonth() + 1) +
" พ.ศ. " +
yy
);
return value.getDate() + " เดือน " + Extension.ToThaiMonth(value.getMonth() + 1) + " พ.ศ. " + yy;
}
public static sumObjectValues(array: any, propertyName: any) {