You are here

function fape_field_edit_node_created_form_validate in Field API Pane Editor (FAPE) 7

Validates that the submitted date exists and is a valid Unix timestamp.

See also

node_validate()

1 string reference to 'fape_field_edit_node_created_form_validate'
fape_field_edit_node_created_form in ./fape.module
Subform to edit the entity 'created' field.

File

./fape.module, line 410
Adds direct field editing via contextual links.

Code

function fape_field_edit_node_created_form_validate($form, &$form_state) {
  $date = $form_state['values']['date'];
  if (!empty($date) && strtotime($date) === FALSE) {
    form_set_error('date', t('You have to specify a valid date.'));
  }
}