add: calendar view & calculator view
This commit is contained in:
@@ -9,4 +9,22 @@ export const getDateMonthDay = (value) => {
|
||||
year: 'numeric',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
export const getDateTime = (value, hour) => {
|
||||
|
||||
const date = new Date(value);
|
||||
date.setHours(date.getHours() + hour);
|
||||
|
||||
// Obtener los componentes de la fecha
|
||||
const year = date.getFullYear();
|
||||
const month = ('0' + (date.getMonth() + 1)).slice(-2); // Agrega cero al principio si es necesario
|
||||
const day = ('0' + date.getDate()).slice(-2); // Agrega cero al principio si es necesario
|
||||
const hours = ('0' + date.getHours()).slice(-2); // Agrega cero al principio si es necesario
|
||||
const minutes = ('0' + date.getMinutes()).slice(-2); // Agrega cero al principio si es necesario
|
||||
|
||||
// Crear la cadena de fecha formateada
|
||||
const dateFormat = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
|
||||
return dateFormat;
|
||||
}
|
||||
@@ -33,6 +33,41 @@ export const getStatusLoad = (load) => {
|
||||
};
|
||||
}
|
||||
|
||||
export const eventStatusLoad = (loadStatus) => {
|
||||
let color;
|
||||
let status;
|
||||
switch (loadStatus) {
|
||||
case 'Published':
|
||||
status = "Publicado";
|
||||
color = "yellow";
|
||||
break;
|
||||
case 'Loading':
|
||||
color = "green";
|
||||
status = "Cargando";
|
||||
break;
|
||||
case 'Transit':
|
||||
status = "En Transito";
|
||||
color = "red"
|
||||
break;
|
||||
case 'Downloading':
|
||||
status = "Descargando";
|
||||
color = "blue"
|
||||
break;
|
||||
case 'Delivered':
|
||||
color = "blue";
|
||||
status = "Entregado";
|
||||
break;
|
||||
default:
|
||||
color = "yellow";
|
||||
status = 'Sin publicar';
|
||||
break;
|
||||
}
|
||||
return {
|
||||
color,
|
||||
status
|
||||
};
|
||||
}
|
||||
|
||||
export const getStatusPublished = (load) => {
|
||||
let status;
|
||||
switch (load.status) {
|
||||
|
||||
Reference in New Issue
Block a user