AC2 Bug #14 - Date Picker First Shows a Calendar of NaN

Wappler Version : 5.8.2 Beta dmxAppConnect (2023-06-27 12:52)
Operating System : Windows
Server Model: PHP
Database Type: MySQL
Hosting Type: WAMP

Expected behavior

What do you think should happen?

With the following code, this date picker should show dates from now onwards…

<input id="i_activity_start_date" is="dmx-date-picker" timepicker="" 
minutes-increment="5" name="start_date" type="text" 
class="form-control input_text" 
dmx-bind:value="activity.data.activity_event.start_date + ' ' + activity.data.activity_event.start_time" 
dmx-bind:placeholder="show_label.items.contains(2200)?'':apptext.value.2202" 
dmx-bind:disabled="view_edit_mode.value=='view'" format="dddd D MMMM YYYY (h:mm a)" 
dmx-bind:mindate="current_datetime.datetime">

date_time

Actual behavior

What actually happens?

The first time you click into it, it shows this:

Screenshot 2023-06-28 142942

Then after that it shows a sensible calendar.

what is the exact value this expression returns?

activity.data.activity_event.start_date + ' ' + activity.data.activity_event.start_time

Got a bit more feedback from the console…

When I had the NaN issues, the console showed lots of these…

And when I generally access the page with this form on, I get some of this:

That’s a good question… as this topic is mixed in with #13 where it isn’t saving the date values…

So when I have some date and time values that saved correctly, the activity_event data looks like this:

dates_data_good

And when this problem happens, the date and times values are null:

dates_data_null

So the field evaluates in this case to a blank space:

start_date_value

What I can say is that:

  1. It doesn’t happen if the date and time information is loaded correctly (so isn’t null)
  2. It only happens for the Start Date/Time field and not the End one
  3. If I load the page for a different event and then come back to the one that had the issue (so still has null date/time), then the problem goes away.
  4. Because there is a valid min-date, I would expect it to show a functioning calendar from that date onwards right away.

I hope all that helps!

Antony.

Please test the following update

dmxDatePicker.zip (2.5 KB)

@patrick, this is not fixed by dmxDatePicker.js @build 2023-07-21 16:03:32…

In fact it makes things worse, as it also displays the dates in tbe input in 2023-09-24 00:00:00 format rather than using the date formatter to display Sunday 24 September 2023 (12:00 am) as the stable channel shows…

I’m getting this message in the console when the page is viewed:

image

Here a new update, this time I also included the map files to get error messages with correct line numbers and code. It also contains some logging for debugging.

dmxDatePicker.zip (18.0 KB)

Hi Patrick… I’m just about to do this test… the zip has a .map file in it - do I need to do anything with that? :thinking:

@patrick, this is fixed with @build 2023-07-25 11:24:44…