fixbug timezone and add facades
This commit is contained in:
1 parent
1b72a5e0fe
commit
2acc6826ab
5 files changed
+22
-4
No files matched your search
@@ -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';
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user