datetimepicker ignoring format

Good day all. I know the datetimepicker isn’t officially supported but if someone can either confirm this or point me in the right direction I’d appreciate it. So using the I’m attempting to get the date time picker to render date and time in 12 hour am pm (same code worked fine in 2019). But in 2020 it appears to not recognize the momentjs format and returns in ISO 8601 format. For example my code for my field is {“sideBySide”:true,“format”:“DD/MM/YYYY hh:mm A”}. Even a simple format {“sideBySide”:true,“format”:“L LT”} is not recognized and returns in ISO 8601 format. Can anyone confirm/assist? Thanks.

In which section did you put that code?

In both the dedicated area for Tools → Extensions > Datetimepicker → Advanced → Fields
and i tried manually creating/callining the datetimepicker in add/edit client startup script eg ew.createDateTimePicker(“formname”, “x1_fieldname”, {“ignoreReadonly”:true,“useCurrent”:false,“format”:2,“sideBySide”:true,“format”:“L LT”});
same thing. no console errors. just returns ISO 8601.

See the generated code in js/ew.js file. There are some code that you may refer to for the date/time format.

i checked it out but i can’t particularly make out anything that I can easily edit tbh.

In addition I’ve tried manually calling the built in tempus like $(‘#x_fieldname’).datetimepicker(); nothing (undefined when i call it in the console log)

I’ve tried disabling the built in tempus by unchecking datetimepicker from the extensions, redownloading tempus fro github and calling it (mind you i do know how to load 3rd party plugins). nothing (undefined when i call it in the console log)

I’ve tried another 3rd party plugin from xdsoft. nothing.(undefined when i call it in the console log)

In the previous two cases I believe there’s problem calling the plugins with the same function name that phpmaker originally recognizes. So I can’t call any third party plugin with the function name “datetimepicker”…

To test again i loaded yet another plugin fortunately this had a different function name “timepicker” and i was able to call it with $(‘#x_fieldname’).timepicker(); within phpmaker and also in the console log.

As it stands now my only choice might be to rename the function name of a 3rd party plugin but looking at the code that doesn’t seem so simple…

Date format is determined by the format you specified under the View Tag settings (see the topic Field Setup in help file), setting format in options won’t work. Even it works, PHPMaker script cannot convert to back to the format that database can understand because your format is unknown to the script. If you want to specify the format the date time picker, you may use the “datetimepicker” client side event (similar to the “create.editor” example in the topic Server Events and Client Scripts > Table-Specific → Add/Copy page > Client Script → Example 4), but you need to to customize the UnFormatDateTime() in phpfn.php yourself so that your format can be converted.

the final and easiest check to do is load up the online demo site and on the login page call datepicker in the browser console like $(‘#username’).datetimepicker(); voila the username field turns into a date as it should.
however if you generate a brand new local demo site and try the same thing $(‘#username’).datetimepicker(); undefined…
i definitely can’t call that specific function name