當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。