Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
date.php
Go to the documentation of this file.
1 <?php
6  function &buildWidget(&$record, &$field, $form, $formFieldName, $new=false){
7 
8  $widget =& $field['widget'];
9  $factory =& Dataface_FormTool::factory();
10  $el =& $factory->addElement('date', $formFieldName, $widget['label'], $widget);
11  return $el;
12 
13  }
14 
15  function pushValue(&$record, &$field, &$form, &$element, &$metaValues){
16  $table =& $record->_table;
17  $formTool =& Dataface_FormTool::getInstance();
18  $formFieldName = $element->getName();
19  if ( $table->isDate($field['name']) ){
20  return Dataface_converters_date::qf2Table($element->getValue());
21 
22  } else if ( $table->isInt($field['name']) ){
23  return Dataface_converters_date::qf2UnixTimestamp($element->getValue()) ;
24 
25  } else {
27  Dataface_converters_date::qf2Table($element->getValue())
28  );
29  }
30 
31  }
32 }