Add transfer and account_state today view to reception

This commit is contained in:
2016-10-01 18:41:21 +02:00
parent d46e717b53
commit 8b6b506d17
13 changed files with 632 additions and 127 deletions

View File

@@ -12,6 +12,34 @@ use yii\i18n\Formatter;
class DateUtil
{
/**
* Get UTC today @00:00:00 .
* Helper method to generate date for mysql
*
* @return \DateTime
*/
public static function todayStart( ){
$d2 = new \DateTime();
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
$d2->setTime(0, 0, 0);
return $d2;
}
/**
* Get UTC t @00:00:00 .
* Helper method to generate date for mysql
*
* @return \DateTime
*/
public static function tomorrowStart( ){
$d2 = new \DateTime();
$d2->add(new \DateInterval('P1D'));
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
$d2->setTime(0, 0, 0);
return $d2;
}
public static function addMonth($timestamp, $monthCount = 1)
{
@@ -65,4 +93,12 @@ class DateUtil
return $formatter->asDatetime($dateTimeObject);
}
public static function formatDateUtc($dateTimeObject)
{
$formatter = new Formatter;
$formatter->datetimeFormat = 'php:Y-m-d';
$formatter->timeZone = 'UTC';
return $formatter->asDatetime($dateTimeObject);
}
}