39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
export function formattedDate(timestamp){
|
|
const date = new Date(timestamp);
|
|
const year = date.getFullYear();
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
const day = date.getDate().toString().padStart(2, '0');
|
|
const formattedDate = `${year}-${month}-${day}`;
|
|
return formattedDate
|
|
}
|
|
export function DetailformattedDate(timestamp){
|
|
const date = new Date(timestamp);
|
|
const year = date.getFullYear();
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
const day = date.getDate().toString().padStart(2, '0');
|
|
const hour = date.getHours().toString().padStart(2, '0');
|
|
const minute = date.getMinutes().toString().padStart(2, '0');
|
|
const second = date.getSeconds().toString().padStart(2, '0');
|
|
const formattedDate = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
return formattedDate
|
|
}
|
|
|
|
export function verifyPerson(){
|
|
|
|
let userInfoJson = window.sessionStorage.getItem("USER_LOGIN_STATE");
|
|
// console.log(userInfoJson)
|
|
if(JSON.parse(userInfoJson).userRole==1)
|
|
{
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
//console.log(ax.value)
|
|
}
|
|
|
|
|
|
export function getBusinessID(){
|
|
let JS=window.sessionStorage.getItem("BUSINESS_STATE");
|
|
const id=JSON.parse(JS).id
|
|
return id;
|
|
} |