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


PHP JevDate::toFormat方法代码示例

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


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

示例1: Defaultgetstartenddates

function Defaultgetstartenddates($view)
{
    $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
    $startdate = JRequest::getString("startdate", "");
    $enddate = JRequest::getString("enddate", "");
    if ($startdate == "") {
        if ($params->get("relative", "rel") == "abs") {
            $startdate = $params->get("absstart", "");
            list($startyear, $startmonth, $startday) = explode("-", $startdate);
        } else {
            if ($params->get("relative", "rel") == "strtotime") {
                $value = $params->get("strstart", "");
                $value = new JevDate(JevDate::strtotime($value));
                $startdate = $value->toFormat("%Y-%m-%d");
            } else {
                $value = $params->get("relstart", "");
                $value = str_replace(",", " ", $value);
                $value = str_replace("y", "year", $value);
                $value = str_replace("d", "day", $value);
                $value = str_replace("w", "week", $value);
                $value = str_replace("m", "month", $value);
                $value = new JevDate($value);
                $startdate = $value->toFormat("%Y-%m-%d");
            }
        }
    }
    if ($enddate == "") {
        if ($params->get("relative", "rel") == "abs") {
            $enddate = $params->get("absend", "");
        } else {
            if ($params->get("relative", "rel") == "strtotime") {
                $value = $params->get("strend", "");
                $value = new JevDate(JevDate::strtotime($value));
                $enddate = $value->toFormat("%Y-%m-%d");
            } else {
                $value = $params->get("relend", "");
                $value = str_replace(",", " ", $value);
                $value = str_replace("y", "year", $value);
                $value = str_replace("d", "day", $value);
                $value = str_replace("w", "week", $value);
                $value = str_replace("m", "month", $value);
                $value = new JevDate($value);
                $enddate = $value->toFormat("%Y-%m-%d");
            }
        }
    }
    if ($enddate < $startdate) {
        // default to 1 year when input dates are not valid!
        $value = new JevDate($startdate);
        $value->add(new DateInterval('P1Y'));
        $enddate = $value->toFormat("%Y-%m-%d");
    }
    return array($startdate, $enddate);
}
开发者ID:madcsaba,项目名称:li-de,代码行数:54,代码来源:defaultgetstartenddates.php

示例2: listevents

 function listevents($tpl = null)
 {
     JEVHelper::componentStylesheet($this);
     $params =& JComponentHelper::getParams(JEV_COM_COMPONENT);
     $value = trim($params->get("relstart", ""));
     if ($value != "") {
         $value = str_replace(",", " ", $value);
         $value = str_replace("y", "year", $value);
         $value = str_replace("d", "day", $value);
         $value = str_replace("w", "week", $value);
         $value = str_replace("m", "month", $value);
         $value = new JevDate($value);
         $startdate = $value->toFormat("%Y-%m-%d");
         list($startyear, $startmonth, $startday) = explode("-", $startdate);
     } else {
         $startyear = $params->get("com_earliestyear", 2008);
         $startdate = $startyear . "-01-01";
         $startmonth = 1;
         $startday = 1;
     }
     if ($value != "") {
         $value = trim($params->get("relend", ""));
         $value = str_replace(",", " ", $value);
         $value = str_replace("y", "year", $value);
         $value = str_replace("d", "day", $value);
         $value = str_replace("w", "week", $value);
         $value = str_replace("m", "month", $value);
         $value = new JevDate($value);
         $enddate = $value->toFormat("%Y-%m-%d");
         list($endyear, $endmonth, $endday) = explode("-", $enddate);
     } else {
         $endyear = $params->get("com_latestyear", 2020);
         $enddate = $endyear . "-12-31";
         $endmonth = 12;
         $endday = 31;
     }
     $this->assign("startdate", $startdate);
     $this->assign("startyear", $startyear);
     $this->assign("startmonth", $startmonth);
     $this->assign("startday", $startday);
     $this->assign("enddate", $enddate);
     $this->assign("endyear", $endyear);
     $this->assign("endmonth", $endmonth);
     $this->assign("endday", $endday);
     // Note that using a $limit value of -1 the limit is ignored in the query
     $this->assign("data", $this->datamodel->getRangeData($startdate, $enddate, $this->limit, $this->limitstart));
 }
开发者ID:brojask,项目名称:colegio-abogados-joomla,代码行数:47,代码来源:view.html.php

示例3: onSearch


//.........这里部分代码省略.........
                 $wheres2 = array();
                 foreach ($search_ical_attributes as $search_item) {
                     $wheres2[] = "LOWER({$search_item}) LIKE " . $word;
                 }
                 $wheres[] = implode(' OR ', $wheres2);
             }
             $where_ical = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheres) . ')';
             break;
     }
     if (count($extrasearchfields) > 0) {
         $extraor = implode(" OR ", $extrasearchfields);
         $extraor = " OR " . $extraor;
         // replace the ### placeholder with the keyword
         // $text is already exscaped above
         $extraor = str_replace("###", $text, $extraor);
         $where_ical .= $extraor;
     }
     // some of the where statements may already be escaped
     $where_ical = str_replace("%'%'", "%'", $where_ical);
     $where_ical = str_replace("''", "'", $where_ical);
     $where_ical = str_replace("'%'%", "'%", $where_ical);
     $morder = '';
     $morder_ical = '';
     switch ($ordering) {
         case 'oldest':
             $order = 'a.created ASC';
             $order_ical = 'det.created ASC';
             break;
         case 'popular':
             $order = 'a.hits DESC';
             $order_ical = 'det.created ASC';
             // no hit field available
             break;
         case 'alpha':
             $order = 'a.title ASC';
             $order_ical = 'det.summary ASC';
             break;
         case 'category':
             $order = 'b.title ASC, a.title ASC';
             $morder = 'a.title ASC';
             $order_ical = 'b.title ASC, det.summary ASC';
             $morder_ical = 'det.summary ASC';
             break;
         case 'newest':
         default:
             $order = 'a.created DESC';
             $order_ical = 'det.created DESC';
             break;
     }
     $eventstitle = JText::_("Events Calendar");
     // Now Search Icals
     $display2 = array();
     foreach ($search_ical_attributes as $search_ical_attribute) {
         $display2[] = "{$search_ical_attribute}";
     }
     $display = 'CONCAT(' . implode(", ' ', ", $display2) . ')';
     $query = "SELECT det.evdet_id, det.summary as title," . "\n ev.created as created," . "\n {$display} as text," . "\n CONCAT('{$eventstitle}','/',det.summary) AS section," . "\n CONCAT('index.php?option=com_jevents&task=icalrepeat.detail&evid=',min(rpt.rp_id)) AS href," . "\n '2' AS browsernav ," . "\n rpt.startrepeat, rpt.rp_id " . "\n FROM (#__jevents_vevent as ev)" . "\n LEFT  JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . $catjoin . "\n LEFT  JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . "\n LEFT  JOIN #__jevents_icsfile as icsf ON icsf.ics_id = ev.icsid" . $extrajoin . "\n WHERE ({$where_ical})" . "\n AND icsf.state = 1" . "\n AND icsf.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . $groups . ')' : ' <=  ' . $user->gid) . "\n AND ev.state = 1" . "\n AND ev.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . $groups . ')' : ' <=  ' . $user->gid) . "\n AND b.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . $groups . ')' : ' <=  ' . $user->gid) . "\n AND b.published = '1'" . $extrawhere . $catwhere . "\n GROUP BY det.evdet_id" . "\n ORDER BY " . ($morder_ical ? $morder_ical : $order_ical) . $limit;
     $db->setQuery($query);
     $list_ical = $db->loadObjectList('evdet_id');
     jimport('joomla.utilities.date');
     if ($list_ical) {
         foreach ($list_ical as $id => $item) {
             $user = JFactory::getUser();
             $query = "SELECT ev.*, ev.state as published, rpt.*, rr.*, det.*, ev.created as created, ex_id, exception_type " . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat  ) as ydn, MONTH(rpt.endrepeat   ) as mdn, DAYOFMONTH(rpt.endrepeat   ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat  ) as hdn, MINUTE(rpt.endrepeat   ) as mindn, SECOND(rpt.endrepeat   ) as sdn" . "\n FROM #__jevents_vevent as ev" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_exception as ex ON det.evdet_id = ex.eventdetail_id" . "\n WHERE ev.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . $groups . ')' : ' <=  ' . $user->gid) . "\n AND det.evdet_id = {$id}" . "\n ORDER BY rpt.startrepeat ASC limit 1";
             $db->setQuery($query);
             $row = $db->loadObject();
             if (!$row) {
                 continue;
             }
             $event = new jIcalEventRepeat($row);
             // only get the next repeat IF its not an exception
             if (is_null($row->ex_id)) {
                 $event = $event->getNextRepeat();
             }
             $startdate = new JevDate(strtotime($event->_startrepeat));
             $item->title = $item->title . " (" . $startdate->toFormat($dateformat) . ")";
             $item->startrepeat = $event->_startrepeat;
             $myitemid = $this->params->get("target_itemid", 0);
             if ($myitemid == 0) {
                 // I must find the itemid that allows this event to be shown
                 $catidsOut = $modcatids = $catidList = $modparams = $showall = "";
                 // Use the plugin params to ensure menu item is picked up
                 //$modparams = new JRegistry($this->_plugin->params);
                 $modparams = new JRegistry(null);
                 // pretend to have category restriction
                 $modparams->set("catid0", $row->catid);
                 $modparams->set("ignorecatfilter", 1);
                 $myitemid = findAppropriateMenuID($catidsOut, $modcatids, $catidList, $modparams->toObject(), $showall);
             }
             $item->href = $event->viewDetailLink($event->yup(), $event->mup(), $event->dup(), false, $myitemid);
             $link = $item->href;
             $list_ical[$id] = $item;
         }
     }
     // Must reset the timezone back!!
     if ($tz && is_callable("date_default_timezone_set")) {
         date_default_timezone_set($timezone);
     }
     return $list_ical;
 }
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:101,代码来源:eventsearch.php

示例4: processMatch

 protected function processMatch(&$content, $match, $dayEvent, $dateParm, $relDay)
 {
     $datenow = JEVHelper::getNow();
     $dispatcher = JDispatcher::getInstance();
     // get the title and start time
     $startDate = JevDate::strtotime($dayEvent->publish_up());
     if ($relDay > 0) {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " +{$relDay} days");
     } else {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " {$relDay} days");
     }
     $endDate = JevDate::strtotime($dayEvent->publish_down());
     list($st_year, $st_month, $st_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     list($ev_year, $ev_month, $ev_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     $task_events = 'icalrepeat.detail';
     switch ($match) {
         case 'endDate':
         case 'startDate':
         case 'eventDate':
             // Note we need to examine the date specifiers used to determine if language translation will be
             // necessary.  Do this later when script is debugged.
             if (!$this->disableDateStyle) {
                 $content .= '<span class="mod_events_latest_date">';
             }
             if (!$dayEvent->alldayevent() && $match == "endDate" && ($dayEvent->noendtime() && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate() || $dayEvent->getUnixStartTime() == $dayEvent->getUnixEndTime())) {
                 $time_fmt = "";
             } else {
                 if (!isset($dateParm) || $dateParm == '') {
                     if ($this->com_calUseStdTime) {
                         $time_fmt = $dayEvent->alldayevent() ? '' : IS_WIN ? ' @%I:%M%p' : ' @%l:%M%p';
                     } else {
                         $time_fmt = $dayEvent->alldayevent() ? '' : ' @%H:%M';
                     }
                     $dateFormat = $this->displayYear ? '%a %b %d, %Y' . $time_fmt : '%a %b %d' . $time_fmt;
                     $jmatch = new JevDate(${$match});
                     $content .= $jmatch->toFormat($dateFormat);
                     //$content .= JEV_CommonFunctions::jev_strftime($dateFormat, $$match);
                 } else {
                     // format endDate when midnight to show midnight!
                     if ($match == "endDate" && $dayEvent->sdn() == 59) {
                         $tempEndDate = $endDate + 1;
                         if ($dayEvent->alldayevent()) {
                             // if an all day event then we don't want to roll to the next day
                             $tempEndDate -= 86400;
                         }
                         $match = "tempEndDate";
                     }
                     // if a '%' sign detected in date format string, we assume JevDate::strftime() is to be used,
                     if (preg_match("/\\%/", $dateParm)) {
                         $jmatch = new JevDate(${$match});
                         $content .= $jmatch->toFormat($dateParm);
                     } else {
                         $content .= date($dateParm, ${$match});
                     }
                     if ($match == "tempDndDate") {
                         $match = "endDate";
                     }
                 }
             }
             if (!$this->disableDateStyle) {
                 $content .= "</span>";
             }
             break;
         case 'title':
             $title = $dayEvent->title();
             if (!empty($dateParm)) {
                 $parts = explode("|", $dateParm);
                 if (count($parts) > 0 && strlen($title) > intval($parts[0])) {
                     $title = substr($title, 0, intval($parts[0]));
                     if (count($parts) > 1) {
                         $title .= $parts[1];
                     }
                 }
             }
             if (!$this->disableTitleStyle) {
                 $content .= '<span class="mod_events_latest_content">';
             }
             if ($this->displayLinks) {
                 $link = $dayEvent->viewDetailLink($ev_year, $ev_month, $ev_day, false, $this->myItemid);
                 if ($this->modparams->get("ignorefiltermodule", 0)) {
                     $link = JRoute::_($link . $this->datamodel->getCatidsOutLink() . "&filter_reset=1");
                 } else {
                     $link = JRoute::_($link . $this->datamodel->getCatidsOutLink());
                 }
                 $content .= $this->_htmlLinkCloaking($link, JEventsHTML::special($title));
             } else {
                 $content .= JEventsHTML::special($title);
             }
             if (!$this->disableTitleStyle) {
                 $content .= '</span>';
             }
             break;
         case 'category':
             $catobj = $dayEvent->getCategoryName();
             $content .= JEventsHTML::special($catobj);
             break;
         case 'categoryimage':
             $catobj = $dayEvent->getCategoryImage();
             $content .= $catobj;
             break;
//.........这里部分代码省略.........
开发者ID:pguilford,项目名称:vcomcc,代码行数:101,代码来源:latest.php

示例5: htmlspecialchars

        $item_organizer = html_entity_decode( $item_organizer );
        // location for particular item
        $item_location = htmlspecialchars( $row->location() );
        $item_location = html_entity_decode( $item_location );
        // start date for particular item
        $item_startdate = htmlspecialchars( $row->publish_up());
        // end date for particular item
        $item_enddate = htmlspecialchars( $row->publish_down() );
        if (isset($row->_thumbimg1) && $row->_thumbimg1!=""){
        	$item_description = $row->_thumbimg1. "<br/>".$item_description;
        }
        */
        // load individual item creator class
        $item = new JFeedItem();
        // item info
        if ($row->alldayevent()) {
            $temptime = new JevDate($eventDate);
            $item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) . " : " . $item_title;
        } else {
            $temptime = new JevDate($eventDate);
            $item->title = $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) . " : " . $item_title;
        }
        $item->link = $item_link;
        $item->description = $item_description;
        $item->category = $item_type;
        $eventcreated = new JevDate($row->created());
        $item->date = $eventcreated->toUnix(true);
        // add item info to RSS document
        $doc->addItem($item);
    }
}
开发者ID:poorgeek,项目名称:JEvents,代码行数:31,代码来源:rss.php

示例6: maprpts

 function maprpts()
 {
     $db =& JFactory::getDBO();
     $db->setQuery("delete from jos_repbyday");
     $db->query();
     $db->setQuery("SELECT rpt.rp_id, rpt.startrepeat, rpt.endrepeat, evt.catid FROM #__jevents_repetition as rpt LEFT JOIN #__jevents_vevent as evt ON rpt.eventid=evt.ev_id");
     $rpts = $db->loadObjectList();
     jimport("joomla.utilities.date");
     foreach ($rpts as $rpt) {
         $startday = new JevDate(substr($rpt->startrepeat, 0, 10));
         $endday = new JevDate(substr($rpt->endrepeat, 0, 10));
         while ($endday->toUnix() >= $startday->toUnix()) {
             $db->setQuery("replace into jos_jevents_repbyday (rptday,rp_id,catid) values('" . $startday->toFormat('%Y-%m-%d') . "'," . $rpt->rp_id . "," . $rpt->catid . ")");
             $db->query();
             $startday = new JevDate($startday->toUnix() + 86400);
         }
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:18,代码来源:config.php

示例7: processMatch

 protected function processMatch(&$content, $match, $dayEvent, $dateParm, $relDay)
 {
     $datenow = JEVHelper::getNow();
     $dispatcher =& JDispatcher::getInstance();
     // get the title and start time
     $startDate = JevDate::strtotime($dayEvent->publish_up());
     if ($relDay > 0) {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " +{$relDay} days");
     } else {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " {$relDay} days");
     }
     $endDate = JevDate::strtotime($dayEvent->publish_down());
     list($st_year, $st_month, $st_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     list($ev_year, $ev_month, $ev_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     $task_events = 'icalrepeat.detail';
     switch ($match) {
         case 'endDate':
         case 'startDate':
         case 'eventDate':
             // Note we need to examine the date specifiers used to determine if language translation will be
             // necessary.  Do this later when script is debugged.
             if (!$this->disableDateStyle) {
                 $content .= '<span class="mod_events_latest_date">';
             }
             if (!$dayEvent->alldayevent() && $match == "endDate" && ($dayEvent->noendtime() || $dayEvent->getUnixStartTime() == $dayEvent->getUnixEndTime())) {
                 $time_fmt = "";
             } else {
                 if (!isset($dateParm) || $dateParm == '') {
                     if ($this->com_calUseStdTime) {
                         $time_fmt = $dayEvent->alldayevent() ? '' : ' @%l:%M%p';
                     } else {
                         $time_fmt = $dayEvent->alldayevent() ? '' : ' @%H:%M';
                     }
                     $dateFormat = $this->displayYear ? '%a %b %d, %Y' . $time_fmt : '<span class="eventDay">%a</span>  <span class="eventDate">%d<span class="eventMonth">%b</span></span>';
                     $jmatch = new JevDate(${$match});
                     $content .= $jmatch->toFormat($dateFormat);
                     //$content .= JEV_CommonFunctions::jev_strftime($dateFormat, $$match);
                 } else {
                     // format endDate when midnight to show midnight!
                     if ($match == "endDate" && $dayEvent->sdn() == 59) {
                         $tempEndDate = $endDate + 1;
                         if ($dayEvent->alldayevent()) {
                             // if an all day event then we don't want to roll to the next day
                             $tempEndDate -= 86400;
                         }
                         $match = "tempEndDate";
                     }
                     // if a '%' sign detected in date format string, we assume JevDate::strftime() is to be used,
                     if (preg_match("/\\%/", $dateParm)) {
                         $jmatch = new JevDate(${$match});
                         $content .= $jmatch->toFormat($dateParm);
                     } else {
                         $content .= date($dateParm, ${$match});
                     }
                     if ($match == "tempDndDate") {
                         $match = "endDate";
                     }
                 }
             }
             if (!$this->disableDateStyle) {
                 $content .= "</span>";
             }
             break;
         case 'title':
             $title = $dayEvent->title();
             if (!empty($dateParm)) {
                 $parts = explode("|", $dateParm);
                 if (count($parts) > 0 && strlen($title) > intval($parts[0])) {
                     $title = substr($title, 0, intval($parts[0]));
                     if (count($parts) > 1) {
                         $title .= $parts[1];
                     }
                 }
             }
             if (!$this->disableTitleStyle) {
                 $content .= '<span class="mod_events_latest_content">';
             }
             if ($this->displayLinks) {
                 $link = $dayEvent->viewDetailLink($ev_year, $ev_month, $ev_day, false, $this->myItemid);
                 $link = JRoute::_($link . $this->datamodel->getCatidsOutLink());
                 $content .= $this->_htmlLinkCloaking($link, JEventsHTML::special($title));
             } else {
                 $content .= JEventsHTML::special($title);
             }
             if (!$this->disableTitleStyle) {
                 $content .= '</span>';
             }
             break;
         case 'category':
             $catobj = $dayEvent->getCategoryName();
             $content .= JEventsHTML::special($catobj);
             break;
         case 'calendar':
             $catobj = $dayEvent->getCalendarName();
             $content .= JEventsHTML::special($catobj);
             break;
         case 'contact':
             // Also want to cloak contact details so
             $this->modparams->set("image", 1);
             $dayEvent->text = $dayEvent->contact_info();
//.........这里部分代码省略.........
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:latest.php

示例8: htmlspecialchars

        $item_organizer = html_entity_decode( $item_organizer );
        // location for particular item
        $item_location = htmlspecialchars( $row->location() );
        $item_location = html_entity_decode( $item_location );
        // start date for particular item
        $item_startdate = htmlspecialchars( $row->publish_up());
        // end date for particular item
        $item_enddate = htmlspecialchars( $row->publish_down() );
        if (isset($row->_thumbimg1) && $row->_thumbimg1!=""){
        	$item_description = $row->_thumbimg1. "<br/>".$item_description;
        }
        */
        // load individual item creator class
        $item = new JFeedItem();
        // item info
        if ($row->alldayevent()) {
            $temptime = new JevDate($eventDate);
            $item->set('title', $temptime->toFormat(JText::_('JEV_RSS_DATE')) . " : " . $item_title);
        } else {
            $temptime = new JevDate($eventDate);
            $item->set('title', $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) . " : " . $item_title);
        }
        $item->set('link', $item_link);
        $item->set('description', $item_description);
        $item->set('category', $item_type);
        $eventcreated = new JevDate($row->created());
        $item->set('date', $eventcreated->toUnix(true));
        // add item info to RSS document
        $doc->addItem($item);
    }
}
开发者ID:madseller,项目名称:coperio,代码行数:31,代码来源:rss.php

示例9: datetimeToIcsFormat

 /**
  * Function converts datetime to iCal format
  *
  * @param datetime Datetime of the event
  * @return converted datetime in iCal format
  */
 private function datetimeToIcsFormat($datetime)
 {
     $newdatetime = JevDate::strtotime($datetime);
     $tempdate = new JevDate($newdatetime);
     if (strlen($datetime) <= 10 && $tempdate->toFormat("%H:%M:%S") == "00:00:00") {
         // in this case we have not time element so don't set it otherwise iCal import will think a time is actually set and not process all day or no end time events correctly
         return date("Ymd", $newdatetime);
     }
     return date("Ymd", $newdatetime) . "T" . date("His", $newdatetime);
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:16,代码来源:csvLine.php

示例10: Defaultgetstartenddates

function Defaultgetstartenddates($view)
{
    $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
    // fix to allow start/end date to be preserved during pagination IF filter module before/after dates are used
    $Itemid = JRequest::getInt("Itemid", 0);
    // This causes the filter module to reset
    $filters = jevFilterProcessing::getInstance(array());
    $activeFilterMenu = JFactory::getApplication()->getUserState('active_filter_menu ', $Itemid);
    if (intval(JRequest::getVar('filter_reset', 0)) || $activeFilterMenu > 0 && $activeFilterMenu != $Itemid) {
        JRequest::setVar('startdate', '');
        JRequest::setVar('enddate', '');
        JFactory::getApplication()->setUserState('range_enddate' . $Itemid, '');
        JFactory::getApplication()->setUserState('range_startdate' . $Itemid, '');
        JFactory::getApplication()->setUserState('active_filter_menu ', 0);
    }
    $startdate = JFactory::getApplication()->getUserStateFromRequest('range_startdate' . $Itemid, 'startdate', "");
    $enddate = JFactory::getApplication()->getUserStateFromRequest('range_enddate' . $Itemid, 'enddate', "");
    if ($startdate == "") {
        if ($params->get("relative", "rel") == "abs") {
            $startdate = $params->get("absstart", "");
            list($startyear, $startmonth, $startday) = explode("-", $startdate);
        } else {
            if ($params->get("relative", "rel") == "strtotime") {
                $value = $params->get("strstart", "");
                $value = new JevDate(JevDate::strtotime($value));
                $startdate = $value->toFormat("%Y-%m-%d");
            } else {
                $value = $params->get("relstart", "");
                $value = str_replace(",", " ", $value);
                $value = str_replace("y", "year", $value);
                $value = str_replace("d", "day", $value);
                $value = str_replace("w", "week", $value);
                $value = str_replace("m", "month", $value);
                $value = new JevDate($value);
                $startdate = $value->toFormat("%Y-%m-%d");
            }
        }
    }
    if ($enddate == "") {
        if ($params->get("relative", "rel") == "abs") {
            $enddate = $params->get("absend", "");
        } else {
            if ($params->get("relative", "rel") == "strtotime") {
                $value = $params->get("strend", "");
                $value = new JevDate(JevDate::strtotime($value));
                $enddate = $value->toFormat("%Y-%m-%d");
            } else {
                $value = $params->get("relend", "");
                $value = str_replace(",", " ", $value);
                $value = str_replace("y", "year", $value);
                $value = str_replace("d", "day", $value);
                $value = str_replace("w", "week", $value);
                $value = str_replace("m", "month", $value);
                $value = new JevDate($value);
                $enddate = $value->toFormat("%Y-%m-%d");
            }
        }
    }
    if ($enddate < $startdate) {
        // default to 1 year when input dates are not valid!
        $value = new JevDate($startdate);
        $value->add(new DateInterval('P1Y'));
        $enddate = $value->toFormat("%Y-%m-%d");
    }
    return array($startdate, $enddate);
}
开发者ID:hriggs,项目名称:cs-website,代码行数:66,代码来源:defaultgetstartenddates.php


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