You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
953 B
42 lines
953 B
export const isEmpty = (value) => {
|
|
return ( value === 'string ' || value === null ||
|
|
(typeof value === "object" && Object.keys(value).length === 0) ||
|
|
(typeof value === "string" && value.trim().length === 0) );
|
|
};
|
|
|
|
export const dateParser = (num) => {
|
|
let options = {
|
|
hour: "2-digit",
|
|
minute: "2-digit",
|
|
second: "2-digit",
|
|
weekday: "long",
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "numeric",
|
|
};
|
|
|
|
let timestamp = Date.parse(num);
|
|
|
|
let date = new Date(timestamp).toLocaleDateString("fr-FR", options);
|
|
|
|
return date.toString();
|
|
};
|
|
|
|
|
|
|
|
|
|
export const timestampParser = (num) => {
|
|
let options = {
|
|
hour: "2-digit",
|
|
minute: "2-digit",
|
|
second: "2-digit",
|
|
weekday: "long",
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "numeric",
|
|
};
|
|
|
|
let date = new Date(num).toLocaleDateString("fr-FR", options);
|
|
|
|
return date.toString();
|
|
} |