. * * This file is a part of iCalcreator. */ namespace Kigkonsult\Icalcreator\Traits; use Kigkonsult\Icalcreator\Util\Util; /** * DTSTAMP property functions * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.22.23 - 2017-02-02 */ trait DTSTAMPtrait { /** * @var array component property DTSTAMP value * @access protected */ protected $dtstamp = null; /** * Return formatted output for calendar component property dtstamp * * @return string */ public function createDtstamp() { if( Util::hasNodate( $this->dtstamp )) { $this->dtstamp = Util::makeDtstamp(); } return Util::createElement( Util::$DTSTAMP, Util::createParams( $this->dtstamp[Util::$LCparams] ), Util::date2strdate( $this->dtstamp[Util::$LCvalue], 7 ) ); } /** * Set calendar component property dtstamp * * @param mixed $year * @param mixed $month * @param int $day * @param int $hour * @param int $min * @param int $sec * @param array $params * @return bool */ public function setDtstamp( $year, $month = null, $day = null, $hour = null, $min = null, $sec = null, $params = null ) { $this->dtstamp = ( empty( $year )) ? Util::makeDtstamp() : Util::setDate2( $year, $month, $day, $hour, $min, $sec, $params ); return true; } }