当前位置: 首页>>代码示例>>PHP>>正文


PHP DateField::setLocale方法代码示例

本文整理汇总了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;
 }
开发者ID:helpfulrobot,项目名称:azt3k-abc-silverstripe,代码行数:14,代码来源:AbcImageExtension.php

示例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;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:16,代码来源:TrainingCourseScheduleTime.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:entidi-silverstripe-news,代码行数:24,代码来源:NewsPage.php

示例4: setLocale

 function setLocale($locale)
 {
     $this->dateField->setLocale($locale);
     $this->timeField->setLocale($locale);
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例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');
 }
开发者ID:normann,项目名称:sapphire,代码行数:8,代码来源:DateFieldTest.php

示例6: setLocale

 public function setLocale($locale)
 {
     $this->dateField->setLocale($locale);
     $this->timeField->setLocale($locale);
     return $this;
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:6,代码来源:DatetimeField.php


注:本文中的DateField::setLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。