public function configure()
 {
     // these values are defined in the comment to the 'date_format' field of the user table
     $formats = PcCommonData::getDateFormats();
     $this->setWidgets(array('format' => new sfWidgetFormSelect(array('choices' => $formats))));
     $this->setValidators(array('format' => new sfValidatorInteger(array('min' => 0, 'max' => 4))));
     $this->widgetSchema->setLabels(array('format' => __('ACCOUNT_SETTINGS_SELECT_DATE_FORMAT')));
     $this->widgetSchema->setNameFormat('dateFormat[%s]');
 }
 public function configure()
 {
     // these values are defined in the comment to the 'time_format' field of the user table
     $formats = PcCommonData::getWeekStarts();
     $this->setWidgets(array('format' => new sfWidgetFormSelect(array('choices' => $formats))));
     $this->setValidators(array('format' => new sfValidatorInteger(array('min' => 0, 'max' => 1))));
     $this->widgetSchema->setLabels(array('format' => __('ACCOUNT_SETTINGS_FIRST_DOW_LABEL')));
     $this->widgetSchema->setNameFormat('startWeekFormat[%s]');
 }
Example #3
0
 /**
  * Maps the ids on the database to a string:
  * 0 -> Y-m-d
  * 3 -> d-m-Y
  * 4 -> m-d-Y 
  * 
  * @param boolean $returnIndex (=false) - whether to return the actual format or the index
  * @return string
  */
 public function getDateFormat($returnIndex = false)
 {
     if ($returnIndex) {
         return parent::getDateFormat();
     }
     $dt = PcCommonData::getDateFormats();
     return $dt[parent::getDateFormat()];
 }