Skip to content

Commit

Permalink
fix: starting time for new op is app start time, not current time
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jun 29, 2020
1 parent 8a9b253 commit 5afc83d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/map/hooks/useEditorLogic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useEffect, useState} from 'react';
import S from 'sanctuary';
import _ from '../../libs/SaferSanctuary';
import _, {fM} from '../../libs/SaferSanctuary';
import {useHistory} from 'react-router-dom';
import useAdesState from '../../state/AdesState';

Expand Down Expand Up @@ -78,6 +78,12 @@ function UseEditorLogic(refMapOnClick, mapInitialized) {
return [newPolygon];
});
};
setVolumeInfo(volumeInfo => {
volumeInfo.effective_time_begin = new Date();
volumeInfo.effective_time_end = new Date();
volumeInfo.effective_time_end.setUTCHours(volumeInfo.effective_time_end.getUTCHours() + DEFAULT_OPERATION_VALIDITY);
return volumeInfo;
});
actions.map.onClicksDisabled(false);
} else {
refMapOnClick.current = () => {};
Expand Down
18 changes: 16 additions & 2 deletions src/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,15 @@
"show_on_map": "Mostrar en mapa",

"map": {
"clicks_enabled": "Cliquear sobre operaciones y volúmenes de vuelo restringido mostrará sus propiedades. Cliquear aquí para cambiar este comportamiento",
"clicks_disabled": "Cliquear sobre operaciones y volúmenes de vuelo restringido NO mostrará sus propiedades. Cliquear aquí para cambiar este comportamiento",
"filter": {
"proposed": "PROPUESTAS",
"accepted": "ACEPTADAS",
"activated": "ACTIVADAS",
"closed": "CERRADAS",
"nonconforming": "REBELDES",
"rogue": "DESHONESTAS",
"rogue": "ROGUE",
"pending": "PENDIENTES",
"bystate": "Filtrar por estado",
"byid": "Mostrar operación específica",
Expand Down Expand Up @@ -333,7 +335,19 @@
"contextualmenu_map": "Mapa en tiempo real",
"contextualmenu_dashboard": "Panel de control",
"contextualmenu_createnewop": "Crear nueva operación",


"layers": "Capas",
"quickfly": {
"title": "Vuelo rápido",
"add_new": "Agregar nuevo punto",
"name": "Nombre",
"required": "Requerido",
"new_location": "Nuevo punto",
"new_location_created": "¡Nuevo punto creado!",
"creating_new": "Creando nuevo punto de vuelo rápido",
"save": "Guardar",
"info": "La posición del nuevo punto es capturada automáticamente según el área actualmente visible en el mapa."
},
"editor": {
"volume": {
"editingvolume_count": "Editando volúmen {{count}} de la operación",
Expand Down

0 comments on commit 5afc83d

Please sign in to comment.