From c443c97891b0edbefc4c388e4228fe7b24ec579b Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 16 Jan 2005 17:28:19 +0000 Subject: [PATCH] - the day of the week is not displayed when year is prior to 1970 git-svn-id: http://piwigo.org/svn/trunk@698 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 2 +- include/functions_category.inc.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 9b4678f65..07bcb03b7 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -415,7 +415,7 @@ function format_date($date, $type = 'us', $show_time = false) } $formated_date = ''; // before 1970, Microsoft Windows can't mktime - if ($year >= 1970 or substr(PHP_OS, 0, 3) != 'WIN') + if ($year >= 1970) { // we ask midday because Windows think it's prior to midnight with a // zero and refuse to work diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index 2e7ce2903..f66d8bded 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -647,11 +647,14 @@ SELECT COUNT(DISTINCT(id)) AS count $page['title'] .= ' ('; if (isset($page['calendar_day'])) { - $unixdate = mktime(0,0,0, - $page['calendar_month'], - $page['calendar_day'], - $page['calendar_year']); - $page['title'].= $lang['day'][date("w", $unixdate)]; + if ($page['calendar_year'] >= 1970) + { + $unixdate = mktime(0,0,0, + $page['calendar_month'], + $page['calendar_day'], + $page['calendar_year']); + $page['title'].= $lang['day'][date("w", $unixdate)]; + } $page['title'].= ' '.$page['calendar_day'].', '; } if (isset($page['calendar_month']))