|
Revision 15086, 1.8 kB
(checked in by FabianLange, 4 years ago)
|
[1.3] fixed minor regression introduced by i18n update
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class sfWidgetFormI18nDateTime extends sfWidgetFormDateTime |
|---|
| 20 |
{ |
|---|
| 21 |
|
|---|
| 22 |
* Constructor. |
|---|
| 23 |
* |
|---|
| 24 |
* Available options: |
|---|
| 25 |
* |
|---|
| 26 |
* * culture: The culture to use for internationalized strings (required) |
|---|
| 27 |
* |
|---|
| 28 |
* @param array $options An array of options |
|---|
| 29 |
* @param array $attributes An array of default HTML attributes |
|---|
| 30 |
* |
|---|
| 31 |
* @see sfWidgetFormDateTime |
|---|
| 32 |
*/ |
|---|
| 33 |
protected function configure($options = array(), $attributes = array()) |
|---|
| 34 |
{ |
|---|
| 35 |
parent::configure($options, $attributes); |
|---|
| 36 |
|
|---|
| 37 |
$this->addRequiredOption('culture'); |
|---|
| 38 |
|
|---|
| 39 |
$culture = isset($options['culture']) ? $options['culture'] : 'en'; |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
$this->setOption('format', str_replace(array('{0}', '{1}'), array('%time%', '%date%'), sfDateTimeFormatInfo::getInstance($culture)->getDateTimeOrderPattern())); |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
* @see sfWidgetFormDateTime |
|---|
| 47 |
*/ |
|---|
| 48 |
protected function getDateWidget($attributes = array()) |
|---|
| 49 |
{ |
|---|
| 50 |
return new sfWidgetFormI18nDate(array_merge(array('culture' => $this->getOption('culture')), $this->getOptionsFor('date')), $this->getAttributesFor('date', $attributes)); |
|---|
| 51 |
} |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
* @see sfWidgetFormDateTime |
|---|
| 55 |
*/ |
|---|
| 56 |
protected function getTimeWidget($attributes = array()) |
|---|
| 57 |
{ |
|---|
| 58 |
return new sfWidgetFormI18nTime(array_merge(array('culture' => $this->getOption('culture')), $this->getOptionsFor('time')), $this->getAttributesFor('time', $attributes)); |
|---|
| 59 |
} |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|