提交
This commit is contained in:
39
src/util/time.js
Normal file
39
src/util/time.js
Normal file
@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user