Browse Source

setting the time format

master
analuizaff 4 years ago
parent
commit
bb42227492
  1. 8
      src/app/database/databaseLoader.js
  2. 2
      src/app/screens/PluviometerSharingDataScreen.js
  3. 8
      src/app/screens/SharingFloodZonesScreen.js

8
src/app/database/databaseLoader.js

@ -32,7 +32,7 @@ function insertFloodZone({ images, description, passable, location, date, time,
parseFloat(location["longitude"]), parseFloat(location["longitude"]),
parseInt(passable), parseInt(passable),
moment(date).format("DD/MM/YYYY"), moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address, address,
]; ];
@ -48,7 +48,7 @@ function insertPluviometerData({ pluviometer, images, dateTime, time, location,
} }
const values = [ const values = [
moment(dateTime).format("DD/MM/YYYY") +" | "+ moment(time).format("HH:MM"),
moment(dateTime).format("DD/MM/YYYY") +" | "+ moment(time).format("HH:mm"),
JSON.stringify(images), JSON.stringify(images),
parseFloat(location["latitude"]), parseFloat(location["latitude"]),
parseFloat(location["longitude"]), parseFloat(location["longitude"]),
@ -74,7 +74,7 @@ function insertRainData({ images, description, rain, location, date, time, addre
parseFloat(location["latitude"]), parseFloat(location["latitude"]),
parseFloat(location["longitude"]), parseFloat(location["longitude"]),
moment(date).format("DD/MM/YYYY"), moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address, address,
]; ];
@ -98,7 +98,7 @@ function insertRiverData({ images, description, riverScale, location, date, time
parseFloat(location["latitude"]), parseFloat(location["latitude"]),
parseFloat(location["longitude"]), parseFloat(location["longitude"]),
moment(date).format("DD/MM/YYYY"), moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address, address,
]; ];

2
src/app/screens/PluviometerSharingDataScreen.js

@ -54,8 +54,6 @@ function PluviometerSharingDataScreen(props) {
}} }}
onSubmit={(values) => { onSubmit={(values) => {
insertPluviometerData({ ...values, dateTime, time, location, address }); insertPluviometerData({ ...values, dateTime, time, location, address });
console.log("DATA:" + dateTime);
console.log("HORA:" + time);
showMessage({ showMessage({
message: "Informação enviada!", message: "Informação enviada!",
duration: 3000, duration: 3000,

8
src/app/screens/SharingFloodZonesScreen.js

@ -21,10 +21,10 @@ import FormDatePicker from "../components/forms/FormDatePicker";
import FormLocationPicker from "../components/forms/FormLocationPicker"; import FormLocationPicker from "../components/forms/FormLocationPicker";
import { EventLocationContext } from "../context/EventLocationContext"; import { EventLocationContext } from "../context/EventLocationContext";
function submitForm(props) {
/*function submitForm(props) {
console.log(props); console.log(props);
insertFloodZone(props); insertFloodZone(props);
}
}*/
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
images: Yup.array(), images: Yup.array(),
@ -61,9 +61,7 @@ function SharingFloodZonesScreen(props) {
setError(true); setError(true);
return; return;
} }
submitForm({ ...values, passable, location, date, time, address });
console.log("DATA: " + moment(date).format("DD/MM/YYYY"));
console.log("HORA: " + moment(time).format("HH:MM"));
insertFloodZone({ ...values, passable, location, date, time, address });
showMessage({ showMessage({
message: "Informação enviada!", message: "Informação enviada!",
duration: 1950, duration: 1950,

Loading…
Cancel
Save