diff --git a/includes/class-gravityview-merge-tags.php b/includes/class-gravityview-merge-tags.php index 13379c9d2..993d449d6 100644 --- a/includes/class-gravityview-merge-tags.php +++ b/includes/class-gravityview-merge-tags.php @@ -226,6 +226,11 @@ private static function modifier_format( $raw_value, $matches, $value, $field, $ } if ( $field instanceof GF_Field_Date ) { + if ( false === strpos( $modifier, 'no_tz_offset' ) ) { + $modifier = 'no_tz_offset:' . $modifier; + } + + // Skip the timezone offset. return self::format_date( $raw_value, $modifier ); } diff --git a/includes/fields/class-gravityview-field-date.php b/includes/fields/class-gravityview-field-date.php index 29aa499b3..b2bc7f2a7 100644 --- a/includes/fields/class-gravityview-field-date.php +++ b/includes/fields/class-gravityview-field-date.php @@ -64,6 +64,11 @@ public function apply_format_date_modifiers( $return, $raw_value = '', $value = return $return; } + // Skip the timezone offset. + if ( false === strpos( $modifier, 'no_tz_offset' ) ) { + $modifier = 'no_tz_offset:' . $modifier; + } + $return = GravityView_Merge_Tags::format_date( $raw_value, $modifier ); } diff --git a/readme.txt b/readme.txt index b9bf03071..a8a9d77e5 100644 --- a/readme.txt +++ b/readme.txt @@ -29,6 +29,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h #### 🐛 Fixed * Fatal error when searching entries by Approval Status in Views joined with another form using the Multiple Forms extension. * Some merge tag modifiers (e.g., `maxwords`) were not being processed. +* WordPress's timezone offset was not being applied to the Date field's output when using the `:format` merge tag modifier. #### ✨ Improved * Entries added via the Gravity Forms API or while GravityView is inactive can now be filtered using the "Unapproved" status on the Entries page.