Witam,

Próbuję zrobić karuzelę kalendarza, która wyświetla 20 dni (jest to dla strony www dla kina - repertuar - coś w stylu jak na stronie heliosa http://www.helios.pl/21,Rzeszow/StronaGlowna/)
Wszystko działa oprócz tego, że nie potrafię wyświetlić daty po polsku. Trochę raczkuję w phpie.
Próbowałem to zrobić IntlDateFormatter i gdy wyświetlam

$now = new DateTime("D");
echo $daterange->format($now), "\n";

to wyświetla po polsku - jednak nie potrafię się do tego odwołać w pętli. Mam nadzieje, że to co napisałem jest zrozumiałe.

  1.  
  2. if (version_compare(PHP_VERSION, '5.3.0', '<')) {
  3. exit ('IntlDateFormatter is available on PHP 5.3.0 or later.');
  4. }
  5. if (!class_exists('IntlDateFormatter')) {
  6. exit ('You need to install php_intl extension.');
  7. }
  8. $formatter = new IntlDateFormatter(
  9. 'pl_PL',
  10. IntlDateFormatter::FULL,
  11. IntlDateFormatter::NONE
  12. );
  13.  
  14.  
  15.  
  16.  
  17. $begin = new DateTime('today');
  18. $end = new DateTime('+ 19 days');
  19. $daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);
  20.  
  21.  
  22. foreach($daterange as $date){
  23. echo '<div class="carousel-item">';
  24. echo '<a href="#DAY'.$date->format("d").'" data-toggle="tab" class="dka-link-kal">';
  25. echo '<div class="day-div" id="DD'.$date->format("d").'">';
  26.  
  27. echo '<div class="nazwa-dnia">';
  28. echo $date->format("D");
  29. echo '</div>';
  30. echo '<div class="numer-dnia">';
  31. echo $date->format("d");
  32. echo '</div>';
  33. echo '<div class="nazwa-miesiaca">';
  34. echo $date->format("M");
  35. echo '</div>';
  36. echo '</div>';
  37. echo '</div>';
  38. echo '</a>';
  39.  
  40. }
  41.  
  42.  
  43.