How to implement php functions on CF7

Convert a custom PHP date format in ChronoForms 7.

Overview

The issue occurs when migrating a PHP function that uses setlocale and strftime to output a localized month abbreviation, as the standard date shortcode might not directly support this format.
Enable the "Run PHP" behavior in the HTML view's advanced settings to execute custom PHP code, or use the date shortcode with a format string that includes the month abbreviation, as it supports various date formats.

Answered
ChronoForms v7
teldrive teldrive 08 Sep, 2020
i am trying to migrate date format php_function from ccv6 to cf7
setlocale(LC_TIME, 'es_ES.UTF-8');
$fecha = $this->get('ventas_list.row.venta.fecha');
echo strftime("%d %b %y", strtotime($fecha));
but in cf7 i try to use html_custom with php code without success
<?php
$fecha=$this->get("ventas.fecha");
return $fecha;
?>
Max_admin Max_admin 08 Sep, 2020
Enable the "Run PHP" behavior in the HTML view!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 08 Sep, 2020
Answer
it's in the advanced settings!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
teldrive teldrive 10 Sep, 2020
Hi the issue is when you need write month abreviation instead of number, I think date doesn't support itHow to implement php functions on CF7 image 2
Max_admin Max_admin 11 Sep, 2020
it should support any date format string!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
teldrive teldrive 11 Sep, 2020
both of you are right, this works also, I thought that I needed first use "strtotime" function first but is not necessary
venta.fecha:<b style='color:SlateBlue;'>{date:y-M-d$(var:ventas_list.row.venta.fecha)}</b>
This topic is locked and no more replies can be posted.