This commit is contained in:
2024-11-23 13:31:46 +05:00
parent df0856adbe
commit 45b727e572
2 changed files with 21 additions and 2 deletions

View File

@@ -207,3 +207,13 @@ function convertToOriginalFormat($apiPrice) {
$originalPrice = intval($apiPrice) / 100;
return number_format($originalPrice, 2, '.', ''); // Format with 2 decimal places
}
function lastDayOfMonth($month, $year) {
// Create a DateTime object for the first day of the given month
$date = new DateTime("$year-$month-01");
// Modify the date to the last day of the same month
$date->modify('last day of this month');
// Return the formatted date
return $date->format('d');
}