From 5dac9aa61600078dbd682dae2985a8d14cb64667 Mon Sep 17 00:00:00 2001 From: Nikita Sinelnikov Date: Mon, 27 Mar 2023 15:11:43 +0300 Subject: [PATCH] - reviewed #1143; --- includes/core/class-fields.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index b33c5e71..5b834900 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2688,7 +2688,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) { // Normalise date format. $value = $this->field_value( $key, $default, $data ); if ( $value ) { - $value = date( 'Y-m-d', strtotime( $value ) ); + // numeric (either unix or YYYYMMDD). ACF uses Ymd format of date inside the meta tables. + if ( is_numeric( $value ) && strlen( $value ) !== 8 ) { + $unixtimestamp = $value; + } else { + $unixtimestamp = strtotime( $value ); + } + // Ultimate Member date field stores the date in metatable in the format Y/m/d. Convert to it before echo. + $value = date( 'Y/m/d', $unixtimestamp ); } $output .= '