GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
date.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the Date field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 extract( $gravityview_view->getCurrentField() );
12 
13 /**
14  * Unix Epoch probably isn't what you're looking for.
15  * @since 1.7
16  */
17 if( $value === '1970-01-01' ) {
18 
19  /**
20  * @filter `gravityview/fields/date/hide_epoch` Whether to hide `1970-01-01` dates; that is normally an erroneous date. Return false to show value. Use `__return_false` callback.
21  * @param bool $hide_epoch True: hide values that are 1970-01-01. False: show the value.
22  */
23  $hide_epoch = apply_filters( 'gravityview/fields/date/hide_epoch', true );
24 
25  if( $hide_epoch ) {
26  return;
27  }
28 }
29 
30 if( !empty( $field_settings ) && !empty( $field_settings['date_display'] ) && !empty( $value )) {
31 
32  // If there is a custom PHP date format passed via the date_display setting,
33  // use PHP's date format
34  $format = $field_settings['date_display'];
35  $output = date_i18n( $format, strtotime( $value ) );
36 
37 } else {
38 
39  $output = GravityView_Field_Date::date_display( $value, \GV\Utils::get( $field, "dateFormat" ), $field_id );
40 
41 }
42 
43 echo $output;
static getInstance( $passed_post=NULL)
if(gv_empty( $field['value'], false, false)) $format
$field_settings['content']
Definition: custom.php:27
$gravityview_view
Definition: date.php:9
static date_display( $value='', $date_format='mdy', $field_id=0)
Get the default date format for a field based on the field ID and the time format setting...
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22