Exemple #1
0
 /**
  * Format date as Saturday, 20 April 2013, 16:23.
  *
  * @param string $languageCode The language code ex: pl, en
  * @param bool   $timeFormat   Tho one of self::TIME_FORMAT_* constants
  *
  * @return string The formatted date
  */
 public function getLongDate($languageCode, $timeFormat = null)
 {
     if ($this->isHollow()) {
         return '';
     }
     $dayName = Calendar::getDay($this->getDayOw(), $languageCode);
     $monthName = Calendar::getMonth($this->getMonth(), $languageCode);
     $dateStr = $dayName . ', ' . $this->format('j') . ' ' . $monthName . ' ' . $this->format('Y');
     if ($timeFormat) {
         $dateStr .= ', ' . $this->format($timeFormat);
     }
     return $dateStr;
 }
Exemple #2
0
 /**
  * @dataProvider checkLanguageCodeProvider
  *
  * @covers ::checkLanguageCode
  *
  * @param string $langCode
  * @param string $exp
  */
 public function test_checkLanguageCode($langCode, $exp)
 {
     $this->assertSame($exp, Calendar::checkLanguageCode($langCode));
 }