• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

[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

Back
Top