[solved] hidden date_time element in repeated group returns 00-00-00 00:00:00

bea

Active Member
Hi,
I ran into an issue today with a date_time element in a repeated group. I want to show only the time (local), when the repeated groups are added (each line).

I have a date element (mytable___time) and a calc element (mytable___timecalc) to return only the time.
If I set the date element hidden, the date element returned 00:00:00 00:00. It works,when its visible...

I already did already tests with UTC time, but same result.
Would be great to get a hint :)

Cheers,
Bianka
 

Attachments

  • Screen Shot 2019-06-20 at 14.48.42.png
    Screen Shot 2019-06-20 at 14.48.42.png
    38.7 KB · Views: 90
  • Screen Shot 2019-06-20 at 14.48.48.png
    Screen Shot 2019-06-20 at 14.48.48.png
    43.3 KB · Views: 88
  • Screen Shot 2019-06-20 at 14.49.24.png
    Screen Shot 2019-06-20 at 14.49.24.png
    73.8 KB · Views: 90
Hi troester,

yes, its a completely new site with latest github from yesterday. Its the first time I am using date_time in a repeated group...
 
I can't replicate this. I have a repeat group with a date in it, set the same as yours. I tried it hidden, and not hidden, and it correctly stores the current date/time in both cases.

Can you point me at your form? I want to see if the issue is in the JS, or on the server side.

What other element types do you have on your form?

-- hugh
 
OK, figured this one out, fix is here:

https://github.com/Fabrik/fabrik/commit/84b525b744e990bd32e3aecf743ef8069602fbe7

Problem was a little bug in the way we set up the default values for use by the form JS when adding new repeats. Usually defaults are applied server side, when a new form page is being loaded. When editing an existing form, defaults don't get applied. But we need them when adding a new repeat group, even when editing, so we know in the JS what to default the repeated elements to when adding a new repeat. So we set the default in each element's JS options. But ... there was a bug, whereby for the time format in the date element, the default was being passed to the JS in PHP date format ("H:i:s"), not JS format ("%H:%I:%M"). And, long story short, that default was only getting used when the element is hidden ... when visible, the time was set in the time widget itself.

-- hugh
 
  • Like
Reactions: bea
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top