當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DateTimeHelper::formatForJs方法代碼示例

本文整理匯總了PHP中DateTimeHelper::formatForJs方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeHelper::formatForJs方法的具體用法?PHP DateTimeHelper::formatForJs怎麽用?PHP DateTimeHelper::formatForJs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DateTimeHelper的用法示例。


在下文中一共展示了DateTimeHelper::formatForJs方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getJsonObject

 public function getJsonObject()
 {
     $ret = array('departureCity' => $this->getDepartureCity()->localRu, 'departureCityPre' => $this->getDepartureCity()->casePre, 'arrivalCity' => $this->getArrivalCity()->localRu, 'arrivalCityPre' => $this->getArrivalCity()->casePre, 'departureDate' => DateTimeHelper::formatForJs($this->departureDate), 'arrivalDate' => DateTimeHelper::formatForJs($this->getArrivalDate()), 'fullDuration' => $this->fullDuration, 'flightParts' => array());
     foreach ($this->flightParts as $flightPart) {
         $ret['flightParts'][] = $flightPart->getJsonObject();
     }
     return $ret;
 }
開發者ID:niranjan2m,項目名稱:Voyanga,代碼行數:8,代碼來源:Flight.php

示例2: getJsonObject

 public function getJsonObject()
 {
     $airline = Airline::getAirlineByCode($this->transportAirlineCode);
     //echo 1;
     //die();
     if (!$this->markAirline) {
         //$this->markAirline = $airline;
         $ret = array('transportAirline' => $this->transportAirlineCode, 'transportAirlineName' => $airline->localRu, 'transportAirlineNameEn' => $airline->localEn, 'departureCity' => City::getCityByPk($this->departureCityId)->localRu, 'departureCityPre' => City::getCityByPk($this->departureCityId)->casePre, 'departureCityId' => $this->departureCityId, 'arrivalCity' => City::getCityByPk($this->arrivalCityId)->localRu, 'arrivalCityPre' => City::getCityByPk($this->arrivalCityId)->casePre, 'arrivalCityId' => $this->arrivalCityId, 'datetimeBegin' => DateTimeHelper::formatForJs($this->timestampBegin), 'datetimeEnd' => DateTimeHelper::formatForJs($this->timestampEnd), 'flightCode' => $this->code, 'duration' => $this->duration, 'departureAirport' => $this->departureAirport->localRu, 'arrivalAirport' => $this->arrivalAirport->localRu, 'departureAirportId' => $this->departureAirport->id, 'arrivalAirportId' => $this->arrivalAirport->id, 'aircraftCode' => $this->aircraftCode, 'aircraftName' => $this->getAircraftName(), 'stopNum' => $this->stopNum, 'bookingCode' => $this->bookingCodes[0]);
     } else {
         $ret = array('transportAirline' => $this->transportAirlineCode, 'transportAirlineName' => $airline->localRu, 'transportAirlineNameEn' => $airline->localEn, 'markAirline' => $this->markAirline->code, 'markAirlineName' => $this->markAirline->localRu, 'markAirlineNameEn' => $this->markAirline->localEn, 'departureCity' => City::getCityByPk($this->departureCityId)->localRu, 'departureCityPre' => City::getCityByPk($this->departureCityId)->casePre, 'departureCityId' => $this->departureCityId, 'arrivalCity' => City::getCityByPk($this->arrivalCityId)->localRu, 'arrivalCityPre' => City::getCityByPk($this->arrivalCityId)->casePre, 'arrivalCityId' => $this->arrivalCityId, 'datetimeBegin' => DateTimeHelper::formatForJs($this->timestampBegin), 'datetimeEnd' => DateTimeHelper::formatForJs($this->timestampEnd), 'flightCode' => $this->code, 'duration' => $this->duration, 'departureAirport' => $this->departureAirport->localRu, 'arrivalAirport' => $this->arrivalAirport->localRu, 'departureAirportId' => $this->departureAirport->id, 'arrivalAirportId' => $this->arrivalAirport->id, 'aircraftCode' => $this->aircraftCode, 'aircraftName' => $this->getAircraftName(), 'stopNum' => $this->stopNum, 'bookingCode' => $this->bookingCodes[0]);
     }
     //print_r($ret);
     //die();
     return $ret;
 }
開發者ID:niranjan2m,項目名稱:Voyanga,代碼行數:15,代碼來源:FlightPart.php

示例3: getJsonObject

 public function getJsonObject()
 {
     return array('departure' => $this->departureCity->localRu, 'departure_iata' => $this->departureCity->code, 'arrival' => $this->arrivalCity->localRu, 'arrival_iata' => $this->arrivalCity->code, 'date' => DateTimeHelper::formatForJs($this->departureDate));
 }
開發者ID:niranjan2m,項目名稱:Voyanga,代碼行數:4,代碼來源:Route.php

示例4: getJsonObject

 public function getJsonObject()
 {
     $data = array('id' => $this->id, 'active' => false, "startDate" => DateTimeHelper::formatForJs($this->startDate), "endDate" => DateTimeHelper::formatForJs($this->endDate), "address" => $this->address, "contact" => $this->contact, "thumb" => isset($this->pictureSmall) ? $this->imgSrc . $this->pictureSmall->url : $this->defaultThumbImageUrl, "preview" => $this->preview, "description" => $this->description, "image" => isset($this->pictureBig) ? $this->imgSrc . $this->pictureBig->url : $this->defaultBigImageUrl, "title" => $this->title, "categories" => $this->getCategoriesJsonObject(), "links" => $this->getLinksJsonObject(), "tags" => $this->getTagsJsonObject(), "prices" => $this->getPricesJsonObject(), "tours" => $this->getToursJsonObject());
     return $data;
 }
開發者ID:niranjan2m,項目名稱:Voyanga,代碼行數:5,代碼來源:Event.php


注:本文中的DateTimeHelper::formatForJs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。