Skip to content

Commit

Permalink
Carbonize function
Browse files Browse the repository at this point in the history
  • Loading branch information
hanifhefaz committed Apr 8, 2023
1 parent 97432b6 commit 151c499
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Dcter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

namespace HanifHefaz\Dcter;
use \Carbon\Carbon;

// With modification from https://github.com/roozbeh360
// and,
Expand Down Expand Up @@ -266,5 +267,12 @@ public static function JalaliToGregorian($date, $format="YYYY-MM-DD")
$gm = $i+1;
$gd = $g_day_no+1;
return $gy . "-" . $gm . "-" . $gd;
}
}

// Make carbon date object from any converted date.

public static function Carbonize($date)
{
return Carbon::parse($date);
}
}

0 comments on commit 151c499

Please sign in to comment.