Coś pokręciłem? bo mi błąd wywaliło
class StupidDateTime extends DateTime {
public function __construct($time='now', $timezone='Europe/Warsaw')
{
parent::__construct($time, new DateTimeZone($timezone));
}
public function format($format)
{
return $this->enToPl(parent::format($format));
}
private function enToPl($format)
{
$en = ['January','February','March','April','May','June','July','August','September','October','November','December'];
$en2 = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
$pl = ['Stycznia','Lutego','Marca','Kwietnia','Maja','Czerwca','Lipcac','Sierpnia','Września','Października','Listopada','Grudnia'];
$pl2 = ['Sty','Lut','Mar','Kwi','Maj','Cze','Lip','Sie','Wrz','Paź','Lis','Gru'];
}
}
class Date extends I18n_Date
{ function strftimeV($format,$timestamp){
}
public static function relative
($userDTString, $format = 'j.M.Y, H:i', $relativeTo = 'now') {
$StupidDateTime = new DateTime($relativeTo);
$StupidDateTime->setTime(0,0,0);
$userDT = new DateTime($userDTString);
$userDT->setTime(0,0,0);
if($userDT == $dateTime)
return 'dzisiaj';
elseif($userDT == $StupidDateTime->modify('- 1 day'))
return 'wczoraj';
elseif($userDT == $StupidDateTime->modify('- 1 day'))
return '2 dni temu';
$format='j M';
$older = new DateTime($userDTString);
return $older->format($format);
}
public static function my
($value, $type = NULL) {
$format = NULL;
if ($type !== NULL)
{
$format = Kohana::$config->load('date.' . $type);
}
if ($format === NULL)
{
$format = 'd-m-Y';
}
{
$date = date($format, $value); }
else
{
$date = date($format, $date); }
return $date;
}
public static function myy
($value, $type = NULL) {
$format = NULL;
if ($type !== NULL)
{
$format = Kohana::$config->load('date.' . $type);
}
if ($format === NULL)
{
$format = 'H:i';
}
{
$date = date($format, $value); }
else
{
$date = date($format, $date); }
return $date;
}
Failed to load resource: the server responded with a status of 404 (Not Found) <- to pokazuje konsola w Chrome