<?php

namespace FOP;

class DateUtils {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function isInMonth($t, $y, $m) { 
    
    
    // --- BLOCK: main ---
    $t = new \Moment\Moment($timestamp); $m = new \Moment\Moment(); $m->setDate($y, $m, 1); $period = $m->getPeriod('month'); return $t->isBetween($period->getStartDate(), $period->getEndDate());
    
  }

  public static function startOfMonth($ym) { 
    
    
    // --- BLOCK: main ---
    $t = new \Moment\Moment(); $t->setDate(floor($ym / 12), $ym % 12, 1); $period = $t->getPeriod('month'); return $t->getStartDate();
    
  }

  public static function endOfMonth($ym) { 
    
    
    // --- BLOCK: main ---
    $t = new \Moment\Moment(); $t->setDate(floor($ym / 12), $ym % 12, 1); $period = $t->getPeriod('month'); return $t->getEndDate();
    
  }

  public static function vonbis($von, $bis) { 
    
    
    // --- BLOCK: main ---
    
	if (_('dateformat_php') == 'd.m.Y')	return
		(date('Y', $von) == date('Y', $bis) ? 
			(date('m', $von) == date('m', $bis) ? 
				(date('d', $von) == date('d', $bis) ? '' : date('d.', $von) . '–')
			: date('d.m.', $von) . '–')
		: date('d.m.Y', $von) . ' – ') . date('d.m.Y', $bis);
	else if (_('dateformat_php') == 'm/d/Y') return
		(date('Y', $von) == date('Y', $bis) ?
			(date('m/d', $von) == date('m/d', $bis) ? '' : date('m/d', $von) . '–')
		: date('m/d/Y', $von) . ' – ') . date('m/d/Y', $bis);
	else return date(_('dateformat_php'), $von) . ' – ' . date(_('dateformat_php'), $bis);

    
  }


  
  

  
  
}



