Toolset custom field date return value

I have written a small code that i need to add to the DynamicContent.php. But how can i do this using a child theme.
this is the code that i need to add to the "case ‘date’:"function:
if (filter_var($result, FILTER_VALIDATE_INT) !== false) {
$result = intval($result);
}
I need this because toolset returns the date as a timestamp but that timestamp is defined as a string. The function checks if it is a string and uses the strtotime function but that wont work because its already a timestamp so it returns empty. And then the date_i18n function returns the current date.

Hi @djkranendonk,

Thanks for reaching out.
We strongly discourage modifying the theme core file, still, if you want you can add the codes in the child theme using the hooks. I would request you explain what exactly you are trying to do here, so we may assist on this.

Thanks

Hi @tristup

I need to use the countdown from the elements and as value i need de use the toolset daypicker value. The only problem is that toolset returns the value of the daypicker in a timestamp, but instead of being a int it is a string. So when it goes through the strtotime function it returns empty. And when the function ‘date_i18n’ receives an empty string it formats the current date. But when i convert the string to a int the function works as intended, so i added an extra line of code that checks if the string can be converted and if that is the case it converts it to a int. But i don’t know how i can add that to a child theme. I need to edit the file DynamicContent.php in the expand_string_callback function on line 317

Hey @djkranendonk,

That scope is really beyond our support and if you are confident enough with your skills to do it on your own, you can try adding the function in the child theme. You can find it here.

Hope that helps.