no message
This commit is contained in:
parent
6207ba1a91
commit
fc14f80dc9
5 changed files with 725 additions and 575 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue