本文整理汇总了PHP中DateField::setLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP DateField::setLocale方法的具体用法?PHP DateField::setLocale怎么用?PHP DateField::setLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateField
的用法示例。
在下文中一共展示了DateField::setLocale方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Set some fields
$fields->addFieldToTab('Root.Main', new TextField('Location'));
$fields->addFieldToTab('Root.Main', new TextField('CapturedBy'));
// Configure the date field
$df = new DateField('DateCaptured', 'Date Captured (dd/mm/yyyy)');
$df->setLocale('en_NZ');
$df->setConfig('dateformat', 'dd/MM/YYYY');
$df->setConfig('showcalendar', 'true');
$fields->addFieldToTab('Root.Main', $df);
return $fields;
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = new FieldList();
$fields->push(new LiteralField("Title", "<h2>Schedule Time</h2>"));
$start_date = new DateField("StartDate", "Start Date");
$start_date->setLocale('en_US');
$start_date->setConfig('showcalendar', true);
$fields->push($start_date);
$end_date = new DateField("EndDate", "End Date");
$end_date->setLocale('en_US');
$end_date->setConfig('showcalendar', true);
$fields->push($end_date);
$fields->push(new TextField("Link", "Link"));
$fields->push(new HiddenField("LocationID", "Location"));
return $fields;
}
示例3: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$group = new FieldGroup();
$group->setTitle(_t('News.Author'));
$group->setDescription(_t('News.AuthorPage'));
$fields->addFieldToTab('Root.Main', $group, 'Metadata');
$field = new TextField('AuthorName', _t('News.Name'));
$group->push($field);
$field = new TextField('AuthorURI', _t('News.URI'));
$group->push($field);
$field = new TextField('AuthorEmail', _t('News.Email'));
$group->push($field);
$field = new DateField('Published', _t('News.Published'));
$field->setDescription(_t('News.PublishedDescription'));
$field->setLocale($this->config()->date_locale);
$field->setConfig('dateformat', $this->config()->date_format);
$field->setConfig('showcalendar', true);
$fields->addFieldToTab('Root.Main', $field, 'Content');
$field = new HtmlEditorField('Summary', _t('News.Summary'));
$field->setRows(4);
$fields->addFieldToTab('Root.Main', $field, 'Content');
return $fields;
}
示例4: setLocale
function setLocale($locale)
{
$this->dateField->setLocale($locale);
$this->timeField->setLocale($locale);
}
示例5: testSetLocale
public function testSetLocale()
{
// should get en_NZ by default through setUp()
$f = new DateField('Date', 'Date', '29/03/2003');
$f->setLocale('de_DE');
$f->setValue('29.06.2006');
$this->assertEquals($f->dataValue(), '2006-06-29');
}
示例6: setLocale
public function setLocale($locale)
{
$this->dateField->setLocale($locale);
$this->timeField->setLocale($locale);
return $this;
}