GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
time.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the time field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 $gv_field = $gravityview_view->getCurrentField();
12 
13 /** @var string $value Raw time value */
14 $value = rgget( 'value', $gv_field );
15 
16 /** @var string $field_id ID of the field being displayed */
17 $field_id = rgget( 'field_id', $gv_field );
18 
19 $output = '';
20 
21 if( '' !== $value ) {
22 
23  /** @var GF_Field_Time $field Gravity Forms Time field */
24  $field = rgget( 'field', $gv_field );
25 
26  $format = $gravityview_view->getCurrentFieldSetting( 'date_display' );
27 
28  if ( empty( $format ) ) {
29 
30  $field->sanitize_settings();
31 
33  }
34 
35  // If there is a custom PHP date format passed via the date_display setting, use PHP's date format
36  $output = date_i18n( $format, strtotime( $value ) );
37 }
38 
39 echo $output;
$value
Definition: time.php:14
static date_format($time_format= '12', $field_id=0)
Get the default date format for a field based on the field ID and the time format setting...
$output
Definition: time.php:19
$gv_field
Definition: time.php:11
$field_id
Definition: time.php:17
$gravityview_view
Definition: time.php:9
static getInstance($passed_post=NULL)
$field
Definition: gquiz_grade.php:11
if(gv_empty($field['value'], false, false)) $format