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"]),
parseInt(passable),
moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address,
];
@ -48,7 +48,7 @@ function insertPluviometerData({ pluviometer, images, dateTime, time, location,
}
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),
parseFloat(location["latitude"]),
parseFloat(location["longitude"]),
@ -74,7 +74,7 @@ function insertRainData({ images, description, rain, location, date, time, addre
parseFloat(location["latitude"]),
parseFloat(location["longitude"]),
moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address,
];
@ -98,7 +98,7 @@ function insertRiverData({ images, description, riverScale, location, date, time
parseFloat(location["latitude"]),
parseFloat(location["longitude"]),
moment(date).format("DD/MM/YYYY"),
moment(time).format("HH:MM"),
moment(time).format("HH:mm"),
address,
];

2
src/app/screens/PluviometerSharingDataScreen.js

@ -54,8 +54,6 @@ function PluviometerSharingDataScreen(props) {
}}
onSubmit={(values) => {
insertPluviometerData({ ...values, dateTime, time, location, address });
console.log("DATA:" + dateTime);
console.log("HORA:" + time);
showMessage({
message: "Informação enviada!",
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 { EventLocationContext } from "../context/EventLocationContext";
function submitForm(props) {
/*function submitForm(props) {
console.log(props);
insertFloodZone(props);
}
}*/
const validationSchema = Yup.object().shape({
images: Yup.array(),
@ -61,9 +61,7 @@ function SharingFloodZonesScreen(props) {
setError(true);
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({
message: "Informação enviada!",
duration: 1950,

Loading…
Cancel
Save