You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't find a way. I created two meta fields open_date and close_date (date field with timestamp save) for an event registration created with jetengine cpt. I want to show a number like x days left / ends in x days before registration closes based on a comparison of the number of days of the two meta fields above. Can someone help me? And how does the "ending soon" text/badge appear when there is only 1 day left before the close_date?
The text was updated successfully, but these errors were encountered:
I too am interested in a way for this, in mycase I am trying to get the fields diff between a year supplied as a meta field and the current one, the crocoblock date macro %current_date|year% is ignored as an additional argument for calculation
$callbacks['invoice_expiry'] = function( $field_value ) {
$originalDate = jet_engine()->listings->data->get_meta("due-date");
$date = new DateTime($originalDate);
// Add one year to the original date
$newDate = clone $date; // Clone the original date to modify it
$newDate->modify('+1 year');
// Get today's date
$today = new DateTime();
// Calculate the difference in days between today and the new date
$interval = $today->diff($newDate);
$daysDifference = $interval->days;
// Get the new date in the desired format
$result = "<font style='color:red;'>".$daysDifference." days</font> on ".$newDate->format('F j, Y');
return $result;
};
return $callbacks;
I didn't find a way. I created two meta fields open_date and close_date (date field with timestamp save) for an event registration created with jetengine cpt. I want to show a number like x days left / ends in x days before registration closes based on a comparison of the number of days of the two meta fields above. Can someone help me? And how does the "ending soon" text/badge appear when there is only 1 day left before the close_date?
The text was updated successfully, but these errors were encountered: