23 var
$icon =
'dashicons-calendar-alt';
27 $this->label = esc_html__(
'Date',
'gk-gravityview' );
29 add_filter(
'gravityview/merge_tags/modifiers/value', array( $this,
'apply_format_date_modifiers' ), 10, 6 );
31 parent::__construct();
36 if(
'edit' === $context ) {
37 return $field_options;
42 return $field_options;
62 if (
'date' ===
$field->type ) {
82 $parsed_date = GFCommon::parse_date(
$value, $date_format );
87 $date_field_output =
'';
88 switch( $field_input_id ) {
105 $full_date_format = apply_filters(
'gravityview_date_format', $date_format );
107 $full_date = GFCommon::date_display(
$value, $full_date_format );
111 return (
'' === $date_field_output ) ? $full_date : $date_field_output;
Modify field settings by extending this class.
apply_format_date_modifiers( $return, $raw_value='', $value='', $merge_tag='', $modifier='', $field=null)
Allow Date fields to take advantage of the GV date modifiers.
add_field_support( $key, &$field_options)
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
gravityview_get_input_id_from_id( $field_id='')
Very commonly needed: get the # of the input based on a full field ID.
Add custom options for date fields.
if(empty( $created_by)) $form_id
new GravityView_Field_Date
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
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