GravityView  2.9.2
The best, easiest way to display Gravity Forms entries on your website.
field-time-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default time field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since 2.0
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 $field_id = $gravityview->field->ID;
15 $field = $gravityview->field->field;
16 $value = $gravityview->value;
17 
18 $output = '';
19 
20 if ( '' !== $value ) {
21 
22  $format = $gravityview->field->date_display;
23 
24  if ( empty( $format ) ) {
25 
26  $field->sanitize_settings();
27 
29  }
30 
31  // If there is a custom PHP date format passed via the date_display setting, use PHP's date format
32  $output = date_i18n( $format, strtotime( $value ) );
33 }
34 
35 echo $output;
if(gv_empty( $field['value'], false, false)) $format
gravityview()
Definition: _stubs.php:26
if(! isset( $gravityview)||empty( $gravityview->template)) $field_id
The default time field output template.
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...