Skip to content

Commit ba85333

Browse files
committed
feat: make tick function usable without leaf
1 parent 9a7ba6f commit ba85333

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/functions.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
declare(strict_types=1);
44

5-
if (!function_exists('tick') && class_exists('Leaf\App')) {
5+
if (!function_exists('tick')) {
66
/**
77
* Return the leaf date instance
88
*
99
* @return Leaf\Date
1010
*/
1111
function tick(string $userDate = null, string $userTimeZone = null)
1212
{
13+
if (!class_exists('Leaf\App')) {
14+
return (new Leaf\Date())->tick($userDate, $userTimeZone);
15+
}
16+
1317
$date = Leaf\Config::get('date')['instance'] ?? null;
1418

1519
if (!$date) {

0 commit comments

Comments
 (0)