no message

This commit is contained in:
Bright 2024-07-25 16:20:48 +07:00
parent 6207ba1a91
commit fc14f80dc9
5 changed files with 725 additions and 575 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,46 @@
import HttpStatus from "../interfaces/http-status";
import HttpError from "../interfaces/http-error";
import moment from 'moment';
class Extension {
public static ConvertToDateTime(value: any) {
if (value != "" && value != null ) {
if(isNaN(value)){
let date = moment(value, 'DD/MM/YYYY').toDate();
let year = date.getFullYear();
if (year < 1800) {
return null;
} else if (year > 2500) {
date.setFullYear(year - 543);
}
return date;
}
// else {
// return moment.unix(value).format('DD/MM/YYYY');
// }
}
return null;
}
public static CheckRelationship(value: any) {
if(value!= "" && value != null) {
switch(value) {
case 1:
return "โสด";
case 2:
return "สมรส";
case 3:
return "หย่า";
case 4:
return "หม้าย";
default:
return "";
}
}
return "";
}
public static ToThaiMonth(value: number) {
switch (value) {
case 1:

View file

@ -45,7 +45,7 @@ export function calculateRetireDate(birthDate: Date) {
var year = d.getFullYear();
var month = d.getMonth();
var day = d.getDate();
var c = new Date(year + 60, month, day);
var c = new Date(year + 60, month, day-1);
return c;
}
export function calculateRetireLaw(birthDate: Date) {