fixbug timezone and add facades

This commit is contained in:
nasser committed 2017-09-14 20:13:37 +04:30
1 parent 1b72a5e0fe
commit 2acc6826ab
5 files changed
+22 -4

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<?php
namespace Hekmatinasser\Verta\Facades;
use Illuminate\Support\Facades\Facade;
class Verta extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'verta';
}
}
-1
View File
@@ -254,7 +254,6 @@ class Verta extends DateTime {
* @param bool $timezone [optional]
*/
public function __construct($datetime = null, $timezone = null) {
date_default_timezone_set('Asia/Tehran');
if ($datetime === null) {
$instance = time();
}
+2 -2
View File
@@ -4,8 +4,8 @@ if (! function_exists('verta')) {
* @param string $str
* @return \Hekmatinasse\Verta\Verta
*/
function verta($string = null)
function verta($string = null, $timezone = null)
{
return \Hekmatinasser\Verta\Verta::instance($string);
return \Hekmatinasser\Verta\Verta::instance($string, $timezone);
}
}