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


PHP CRM_Utils_Date::getFullMonthNames方法代码示例

本文整理汇总了PHP中CRM_Utils_Date::getFullMonthNames方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Date::getFullMonthNames方法的具体用法?PHP CRM_Utils_Date::getFullMonthNames怎么用?PHP CRM_Utils_Date::getFullMonthNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Utils_Date的用法示例。


在下文中一共展示了CRM_Utils_Date::getFullMonthNames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: preProcess

 /**
  * Function to set variables up before form is built
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);
     $this->assign('bookingId', $this->_id);
     $config = CRM_Core_Config::singleton();
     /**
      * [dateformatDatetime] => %B %E%f, %Y %l:%M %P
      * [dateformatFull] => %B %E%f, %Y
      * [dateformatPartial] => %B %Y
      * [dateformatYear] => %Y
      * [dateformatTime] => %l:%M %P
      */
     $this->crmDateFormat = $config->dateformatDatetime;
     //retrieve crmDateFormat
     $this->assign('dateFormat', $this->crmDateFormat);
     $days = CRM_Booking_Utils_DateTime::getDays();
     $months = CRM_Utils_Date::getFullMonthNames();
     $years = CRM_Booking_Utils_DateTime::getYears();
     $this->assign('days', $days);
     $this->assign('months', $months);
     $this->assign('years', $years);
     $config = CRM_Core_Config::singleton();
     $currencySymbols = "";
     if (!empty($config->currencySymbols)) {
         $currencySymbols = $config->currencySymbols;
     } else {
         $currencySymbols = $config->defaultCurrencySymbol;
     }
     $resourceTypes = CRM_Booking_BAO_Resource::getResourceTypes();
     $resources = array();
     foreach ($resourceTypes as $key => $type) {
         $result = CRM_Booking_BAO_Resource::getResourcesByType($key);
         $rTypekey = trim(strtolower($key . '_' . $type['label']));
         $resources[$rTypekey]['label'] = $type['label'];
         $resources[$rTypekey]['child'] = $result;
     }
     $this->assign('resources', $resources);
     $this->assign('currencySymbols', $currencySymbols);
     $config = CRM_Booking_BAO_BookingConfig::getConfig();
     $this->assign('colour', CRM_Utils_Array::value('slot_new_colour', $config));
     list($xStart, $xSize, $xStep) = CRM_Booking_Utils_DateTime::getCalendarTime();
     $this->assign('xStart', $xStart);
     $this->assign('xSize', $xSize);
     $this->assign('xStep', $xStep);
     $this->assign('timeOptions', CRM_Booking_Utils_DateTime::getTimeRange());
     if ($this->_id && $this->_action == CRM_Core_Action::UPDATE) {
         $title = CRM_Core_DAO::getFieldValue('CRM_Booking_BAO_Booking', $this->_id, 'title', 'id');
         CRM_Utils_System::setTitle(ts('Edit Booking') . " - {$title}");
     } else {
         CRM_Utils_System::setTitle(ts('New Booking'));
     }
     self::registerScripts();
 }
开发者ID:pmevertsen,项目名称:civibooking,代码行数:59,代码来源:SelectResource.php

示例2: ts

<?php

require_once '../../civicrm.config.php';
require_once 'CRM/Core/Config.php';
require_once 'CRM/Core/I18n.php';
require_once 'CRM/Utils/Date.php';
// assign the weekday and month names
$DN = CRM_Utils_Date::getFullWeekdayNames();
$SDN = CRM_Utils_Date::getAbbrWeekdayNames();
$MN = CRM_Utils_Date::getFullMonthNames();
$SMN = CRM_Utils_Date::getAbbrMonthNames();
// assign the strings hash
$TT['INFO'] = ts('About the calendar');
$TT['ABOUT'] = "DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" . ts('For latest version visit: %1', array(1 => 'http://www.dynarch.com/projects/calendar/')) . "\n" . ts('Distributed under GNU LGPL. See %1 for details.', array(1 => 'http://gnu.org/licenses/lgpl.html')) . "\n\n" . ts('Date selection:') . "\n" . ts('- use the \\xab, \\xbb buttons to select year,') . "\n" . ts('- use the \\u2039, \\u203a buttons to select month,') . "\n" . ts('- hold mouse button on any of the above buttons for faster selection.');
$TT['ABOUT_TIME'] = "\n\n" . ts('Time selection:') . "\n" . ts('- click on any of the time parts to increase it') . "\n" . ts('- or Shift-click to decrease it') . "\n" . ts('- or click and drag for faster selection.');
$holdForMenu = ts('hold for menu');
$TT['PREV_YEAR'] = ts('Prev. year') . " ({$holdForMenu})";
$TT['PREV_MONTH'] = ts('Prev. month') . " ({$holdForMenu})";
$TT['GO_TODAY'] = ts('Go Today');
$TT['NEXT_MONTH'] = ts('Next month') . " ({$holdForMenu})";
$TT['NEXT_YEAR'] = ts('Next year') . " ({$holdForMenu})";
$TT['SEL_DATE'] = ts('Select date');
$TT['DRAG_TO_MOVE'] = ts('Drag to move');
$TT['PART_TODAY'] = ' (' . ts('today') . ')';
$TT['DAY_FIRST'] = ts('Display %s first');
$TT['WEEKEND'] = '0,6';
$TT['CLOSE'] = ts('Close');
$TT['TODAY'] = ts('Today');
$TT['TIME_PART'] = ts('(Shift-)Click or drag to change value');
$TT['DEF_DATE_FORMAT'] = '%Y-%m-%d';
$TT['TT_DATE_FORMAT'] = '%a, %b %e';
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:31,代码来源:calendar-lang.php

示例3: convertToDefaultDate

 /**
  * converts the any given date to default date format.
  *
  * @param array  $params     has given date-format
  * @param int    $dateType   type of date  
  * @param string $dateParam  index of params
  * @static
  */
 function convertToDefaultDate(&$params, $dateType, $dateParam)
 {
     if ($dateType == 1) {
         return;
     }
     if ($dateType == 2) {
         if ($params[$dateParam]) {
             $value = $params[$dateParam];
         }
         $year = (int) substr($value, 6, 2);
         $year = $year < 100 ? "19" . "{$year}" : $year;
         $month = (int) substr($value, 0, 2);
         $day = (int) substr($value, 3, 2);
         $month = $month < 10 ? "0" . "{$month}" : $month;
         $day = $day < 10 ? "0" . "{$day}" : $day;
         if ($params[$dateParam]) {
             $params[$dateParam] = "{$year}{$month}{$day}";
         }
     }
     if ($dateType == 4) {
         if ($params[$dateParam]) {
             $value = $params[$dateParam];
         }
         $year = (int) substr($value, 6, 4);
         $month = (int) substr($value, 0, 2);
         $day = (int) substr($value, 3, 2);
         $month = $month < 10 ? "0" . "{$month}" : $month;
         $day = $day < 10 ? "0" . "{$day}" : $day;
         if ($params[$dateParam]) {
             $params[$dateParam] = "{$year}{$month}{$day}";
         }
     }
     if ($dateType == 8) {
         if ($params[$dateParam]) {
             $value = $params[$dateParam];
         }
         $dateArray = explode(' ', $value);
         $monthInt = 0;
         $fullMonths = CRM_Utils_Date::getFullMonthNames();
         foreach ($fullMonths as $key => $val) {
             if ($dateArray[0] == $val) {
                 $monthInt = $key;
                 break;
             }
         }
         if (!$monthInt) {
             $abbrMonths = CRM_Utils_Date::getAbbrMonthNames();
             foreach ($abbrMonths as $key => $val) {
                 if ($dateArray[0] == $val) {
                     $monthInt = $key;
                     break;
                 }
             }
         }
         $year = $dateArray[2];
         $year = $year < 100 ? "19" . "{$year}" : $year;
         $day = (int) $dateArray[1];
         $month = $monthInt < 10 ? "0" . "{$monthInt}" : $monthInt;
         $day = $day < 10 ? "0" . "{$day}" : $day;
         if ($params[$dateParam]) {
             $params[$dateParam] = "{$year}{$month}{$day}";
         }
     }
     if ($dateType == 16) {
         if ($params[$dateParam]) {
             $value = $params[$dateParam];
         }
         $dateArray = explode('-', $value);
         $monthInt = 0;
         $fullMonths = CRM_Utils_Date::getFullMonthNames();
         foreach ($fullMonths as $key => $val) {
             if ($dateArray[1] == $val) {
                 $monthInt = $key;
                 break;
             }
         }
         if (!$monthInt) {
             $abbrMonths = CRM_Utils_Date::getAbbrMonthNames();
             foreach ($abbrMonths as $key => $val) {
                 if ($dateArray[1] == $val) {
                     $monthInt = $key;
                     break;
                 }
             }
         }
         $year = $dateArray[2];
         $year = $year < 100 ? "19" . "{$year}" : $year;
         $day = (int) $dateArray[0];
         $month = $monthInt < 10 ? "0" . "{$monthInt}" : $monthInt;
         $day = $day < 10 ? "0" . "{$day}" : $day;
         if ($params[$dateParam]) {
             $params[$dateParam] = "{$year}{$month}{$day}";
//.........这里部分代码省略.........
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:101,代码来源:Date.php

示例4: HTML_QuickForm_date

 /**
  * Class constructor
  * 
  * @access   public
  * @param    string  Element's name
  * @param    mixed   Label(s) for an element
  * @param    array   Options to control the element's display
  * @param    mixed   Either a typical HTML attribute string or an associative array
  */
 function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
 {
     $this->_locale = array('weekdays_short' => CRM_Utils_Date::getAbbrWeekdayNames(), 'weekdays_long' => CRM_Utils_Date::getFullWeekdayNames(), 'months_short' => CRM_Utils_Date::getAbbrMonthNames(), 'months_long' => CRM_Utils_Date::getFullMonthNames());
     $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_appendName = true;
     $this->_type = 'date';
     // set the options, do not bother setting bogus ones
     if (is_array($options)) {
         foreach ($options as $name => $value) {
             if (isset($this->_options[$name])) {
                 if (is_array($value)) {
                     $this->_options[$name] = @array_merge($this->_options[$name], $value);
                 } else {
                     $this->_options[$name] = $value;
                 }
             }
         }
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:29,代码来源:date.php


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