Browse Source

fixing a datetime picker issue

master
analuizaff 3 years ago
parent
commit
4a77bcef0b
  1. 4
      src/app/components/DatePicker.js
  2. 2
      src/app/hooks/useFiltering.js

4
src/app/components/DatePicker.js

@ -32,9 +32,7 @@ export default function DatePicker(props) {
"DD-MM-YYYYTHH:mm"
).format("DD-MM-YYYYTHH:mm");
if (
moment(new Date(), "DD-MM-YYYYTHH:mm").format("DD-MM-YYYYTHH:mm") <
eventDateTime
) {
moment(new Date(), "DD-MM-YYYYTHH:mm").format("DD-MM-YYYYTHH:mm") < eventDateTime) {
Alert.alert("Horário inválido", "Selecione um horário válido", [
{ text: "OK", onPress: () => renderDatePicker() },
]);

2
src/app/hooks/useFiltering.js

@ -4,7 +4,7 @@ import webSocketClient from "../api/Websockets/webSocketClient";
function useFiltering(location) {
const endpoint = webSocketClient;
const initialDate = moment().add(1, "days").format("YYYY-MM-DDTHH:mm:ss");
const finalDate = moment().subtract(2, "days").format("YYYY-MM-DDTHH:mm:ss");
const finalDate = moment().subtract(1, "days").format("YYYY-MM-DDTHH:mm:ss");
console.log(`Criando sockets do useFiltering: ${moment().format('DD/MM, h:mm:ss:SSS')}`);

Loading…
Cancel
Save