Date Range Picker Insert Issue

I am having an issue where the date range picker is not inserting the dates into the database.

The form is in a modal and working correctly.

Screenshot 2024-02-11 at 9.04.15 AM

The server connect has the three required $_POST variables.

Screenshot 2024-02-11 at 9.05.12 AM

To check to make sure data is being received, I created three output values to display on the page upon form submission.

Screenshot 2024-02-11 at 9.06.15 AM

The output shows the following:

So, it appears that the date range picker on the form is sending the information to the server connect. The server connect is receiving it, but the start and end values are not being conveyed to their respective $_POST variables and as a result, no data is inserted into the database.

Just in case it is needed, I am using Nodejs and MySQL.

Looks ok Scott, as simple as that…

But just let me ask if:

  • in your database insert you bind the {{$_POST.event_start}} and {{$_POST.event_end}} accordingilly…
  • is your column type of datetime

*beside that, can you just try to change the POST name to event_Something not just event (in case it is a reserved work or something)

Yes, both values are bound in the insert table. The other values of the insert work without issue.

Both the event_start and event_end are datetime in the database.

I did try renaming them to date1, date1_start, and date1_end as indicated in the tutorial. I also tried deleting them and recreating them.

I did start from scratch and tried the date picker by itself and it worked without issues and inserted dates/times into both datetime fields.

1 Like

are you on the beta or stable extensions channel?

Beta 6.2.0, sorry I forgot to mention that.

The data seems to been posted correctly, so this is not an issue with the Date Range Picker.

So you did get it to work finally? What was changed in it compared to the not working version?

1 Like

No, sadly, I have not been able to get the date range picker working @patrick. I was referring to the single date picker working as expected.

If it is not an issue with the date range picker, do you know of a reason why the data posted via the data range picker is not showing up in the “Set Values” or inserted into the database?

Have you tried formatting the data to be inserted to the same as your database datetime format? I’m sure we had an issue like this once upon a time… Not sure why we had to do this but seems to ring a bell. As a standalone input for a single date/time all was fine. Worth a shot @scott

I can try it @Cheese when I get off work and see if that resolves it. Thanks for the recommendation! :slight_smile:

If it works, it seems like an easy solution. Although on the surface, it looks like the format is the same as the database.

I have a recollection of something similar. For all intensive purposes everything looked correct but for some reason the date and time were not being inserted. I’m an old man so my memory might be a little shady these days. :slight_smile:

@scott,
Since your post values are sent ok and you get them in server side, I would first try a simple thing just to make sure that the insert is bevaving normally…

Pass the static values in your insert instead of the Post values…
https://community.wappler.io/uploads/default/original/3X/3/6/36f4cd95d53ac1dfed5e135ca8af8b80975bcf9a.png

1 Like

Sorry but I don’t understand something here:

How this:

Is different than this (end/start)?


Nobody is talking about the insert step? What error throws?

The dates are formatted correctly for database insert and you seem to get the data correctly. Can you post the whole action with the insert step.

Here is the server action @patrick.

And the insert action.

And the result.

I think that we already found the issue, here is an update that you can test.

dmxDatePicker.zip (8.9 KB)

4 Likes

That fixed it @patrick!

Thank you for your assistance! :slight_smile:

1 Like

Fixed in Wappler 6.2.2