Skip to content

Commit

Permalink
Name class spouse() changed day monthInt and year if empty to null
Browse files Browse the repository at this point in the history
  • Loading branch information
“duck7000” committed Mar 25, 2024
1 parent 7492a28 commit e42c3a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Imdb/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,13 @@ public function spouse()
}

// From date
$fromDateDay = isset($spouse->timeRange->fromDate->dateComponents->day) ? $spouse->timeRange->fromDate->dateComponents->day : '';
$fromDateMonthInt = isset($spouse->timeRange->fromDate->dateComponents->month) ? $spouse->timeRange->fromDate->dateComponents->month : '';
$fromDateDay = isset($spouse->timeRange->fromDate->dateComponents->day) ? $spouse->timeRange->fromDate->dateComponents->day : null;
$fromDateMonthInt = isset($spouse->timeRange->fromDate->dateComponents->month) ? $spouse->timeRange->fromDate->dateComponents->month : null;
$fromDateMonthName = '';
if (!empty($fromDateMonthInt)) {
$fromDateMonthName = date("F", mktime(0, 0, 0, $fromDateMonthInt, 10));
}
$fromDateYear = isset($spouse->timeRange->fromDate->dateComponents->year) ? $spouse->timeRange->fromDate->dateComponents->year : '';
$fromDateYear = isset($spouse->timeRange->fromDate->dateComponents->year) ? $spouse->timeRange->fromDate->dateComponents->year : null;
$fromDate = array(
"day" => $fromDateDay,
"month" => $fromDateMonthName,
Expand All @@ -508,13 +508,13 @@ public function spouse()
);

// To date
$toDateDay = isset($spouse->timeRange->toDate->dateComponents->day) ? $spouse->timeRange->toDate->dateComponents->day : '';
$toDateMonthInt = isset($spouse->timeRange->toDate->dateComponents->month) ? $spouse->timeRange->toDate->dateComponents->month : '';
$toDateDay = isset($spouse->timeRange->toDate->dateComponents->day) ? $spouse->timeRange->toDate->dateComponents->day : null;
$toDateMonthInt = isset($spouse->timeRange->toDate->dateComponents->month) ? $spouse->timeRange->toDate->dateComponents->month : null;
$toDateMonthName = '';
if (!empty($toDateMonthInt)) {
$toDateMonthName = date("F", mktime(0, 0, 0, $toDateMonthInt, 10));
}
$toDateYear = isset($spouse->timeRange->toDate->dateComponents->year) ? $spouse->timeRange->toDate->dateComponents->year : '';
$toDateYear = isset($spouse->timeRange->toDate->dateComponents->year) ? $spouse->timeRange->toDate->dateComponents->year : null;
$toDate = array(
"day" => $toDateDay,
"month" => $toDateMonthName,
Expand Down

0 comments on commit e42c3a1

Please sign in to comment.