only consider date string in a text field for calendar view

You could try to create a MySQL view which extracts the date part and create a Fabrik list on this MySQL view.
 
Can you add extra fields to the table? If so, you might be able to add a field to use as a calc element, which does ...

Code:
$myJson = json_decode('{yourtable___yourdate}');
return $myJson->value;

Unfortunately, creating a view would be problematic, as MySQL doesn't support any kind of regex for selects. You can search using a regular expression, but you can do anything like "SELECT regex(some_field, '/(\d\d\d\d-\d\d-\d\d)/') as some_date" to extract just the date part from the string. You might be able to come up with something using the string functions like SUBSTR, but it'd be tough.

If you have MySQL 5.7 or greater, you could use the built in JSON_EXTRACT, but I doubt you have 5.7.

-- hugh
 
such a very good clue!
This is my code to retrieve date only in the k2 json...

$ladata = '{ifel2015X_k2_items___extra_fields}';
$ladataclean = str_replace(array( '[', ']' ), '', $ladata);
$myJson = json_decode($ladataclean);
return $myJson->value;

I just needed to remove the square brackets included in k2 extra fields.
But...
But...
Seems to doesn't work when injected in the calendar.
Events are not displayed till I manually insert a value in the calculated column... are you sure the calendar view is able to catch a calculated value?
Thanks a lot.
V.
 
Both give the same results.
I'm now trying with a normal string, just to verify the calc field on calendar view, but the calendar always shut down on blank page when I try to add a calc field.
Any idea?
Thanx
 
This is my actual code that I'd like to test in the title...
Two concatenated text string...

$place = '{ifel2015X_matukio___place}';
$title = '{ifel2015X_matukio___title}';

$mycalc = $title . "<br>" . $place;
return $mycalc;

thnx!

ps. Found that:

NOTE - I'm not 100% sure if just setting "only calc on save" to No will fix your issue in the viz, as I can't recall if, when we load the data for the viz's view, we run the rendering or not. I know we do in list and form views just not sure about cal viz views.

here:
http://fabrikar.com/forums/index.ph...nt-detail-view-with-calculated-content.41521/

So... is the calendar viz definitely able to render a calculated field?
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top