Fix a couple of errors that have sneaked into the date code, plus some minor problems in radar/scatter chart examples, and a spurious html comment that had sneaked into spreadsheet

This commit is contained in:
MarkBaker 2016-08-13 13:28:29 +01:00
parent 3886999957
commit 558da2269d
4 changed files with 15 additions and 13 deletions

View File

@ -103,6 +103,7 @@ $series = new \PHPExcel\Chart\DataSeries(
$dataSeriesLabels, // plotLabel $dataSeriesLabels, // plotLabel
$xAxisTickValues, // plotCategory $xAxisTickValues, // plotCategory
$dataSeriesValues, // plotValues $dataSeriesValues, // plotValues
NULL, // plotDirection
NULL, // smooth line NULL, // smooth line
\PHPExcel\Chart\DataSeries::STYLE_MARKER // plotStyle \PHPExcel\Chart\DataSeries::STYLE_MARKER // plotStyle
); );

View File

@ -89,6 +89,7 @@ $series = new \PHPExcel\Chart\DataSeries(
$dataSeriesLabels, // plotLabel $dataSeriesLabels, // plotLabel
$xAxisTickValues, // plotCategory $xAxisTickValues, // plotCategory
$dataSeriesValues, // plotValues $dataSeriesValues, // plotValues
NULL, // plotDirection
NULL, // smooth line NULL, // smooth line
\PHPExcel\Chart\DataSeries::STYLE_LINEMARKER // plotStyle \PHPExcel\Chart\DataSeries::STYLE_LINEMARKER // plotStyle
); );

View File

@ -40,7 +40,7 @@ class Date
* @private * @private
* @var int * @var int
*/ */
protected static $excelBaseDate = self::CALENDAR_WINDOWS_1900; protected static $excelCalendar = self::CALENDAR_WINDOWS_1900;
/* /*
* Default timezone to use for DateTime objects * Default timezone to use for DateTime objects
@ -132,7 +132,7 @@ class Date
*/ */
public static function excelToDateTimeObject($excelTimestamp = 0, $timeZone = null) { public static function excelToDateTimeObject($excelTimestamp = 0, $timeZone = null) {
$timeZone = ($timeZone === null) ? self::getDefaultTimezone() : self::validateTimeZone($timeZone); $timeZone = ($timeZone === null) ? self::getDefaultTimezone() : self::validateTimeZone($timeZone);
if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { if (self::$excelCalendar == self::CALENDAR_WINDOWS_1900) {
$baseDate = ($excelTimestamp < 60) ? new \DateTime('1899-12-31', $timeZone) : new \DateTime('1899-12-30', $timeZone); $baseDate = ($excelTimestamp < 60) ? new \DateTime('1899-12-31', $timeZone) : new \DateTime('1899-12-30', $timeZone);
} else { } else {
$baseDate = new \DateTime('1904-01-01', $timeZone); $baseDate = new \DateTime('1904-01-01', $timeZone);
@ -159,7 +159,7 @@ class Date
* @throws \Exception * @throws \Exception
*/ */
public static function excelToTimestamp($excelTimestampexcelTimestamp = 0, $timeZone = null) { public static function excelToTimestamp($excelTimestampexcelTimestamp = 0, $timeZone = null) {
return self::excelToTimestamp($excelTimestamp, $timeZone) return self::excelToDateTimeObject($excelTimestamp, $timeZone)
->format('U'); ->format('U');
} }
@ -212,7 +212,7 @@ class Date
*/ */
public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0)
{ {
if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { if (self::$excelCalendar == self::CALENDAR_WINDOWS_1900) {
// //
// Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel // Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel
// This affects every date following 28th February 1900 // This affects every date following 28th February 1900

View File

@ -1,4 +1,4 @@
<!----><?php <?php
namespace PHPExcel; namespace PHPExcel;