Rename WEEKOFYEAR into WEEKNUM for consistency
This commit is contained in:
parent
23fbc845dd
commit
9629151e45
|
@ -39,7 +39,7 @@ CATEGORY_DATE_AND_TIME
|
||||||
TIMEVALUE PHPExcel_Calculation_DateTime::TIMEVALUE
|
TIMEVALUE PHPExcel_Calculation_DateTime::TIMEVALUE
|
||||||
TODAY PHPExcel_Calculation_DateTime::DATENOW
|
TODAY PHPExcel_Calculation_DateTime::DATENOW
|
||||||
WEEKDAY PHPExcel_Calculation_DateTime::DAYOFWEEK
|
WEEKDAY PHPExcel_Calculation_DateTime::DAYOFWEEK
|
||||||
WEEKNUM PHPExcel_Calculation_DateTime::WEEKOFYEAR
|
WEEKNUM PHPExcel_Calculation_DateTime::WEEKNUM
|
||||||
WORKDAY PHPExcel_Calculation_DateTime::WORKDAY
|
WORKDAY PHPExcel_Calculation_DateTime::WORKDAY
|
||||||
YEAR PHPExcel_Calculation_DateTime::YEAR
|
YEAR PHPExcel_Calculation_DateTime::YEAR
|
||||||
YEARFRAC PHPExcel_Calculation_DateTime::YEARFRAC
|
YEARFRAC PHPExcel_Calculation_DateTime::YEARFRAC
|
||||||
|
|
|
@ -365,7 +365,7 @@ VERSION CATEGORY_INFORMATION PHPExcel_Calculation_Fun
|
||||||
VLOOKUP CATEGORY_LOOKUP_AND_REFERENCE PHPExcel_Calculation_LookupRef::VLOOKUP
|
VLOOKUP CATEGORY_LOOKUP_AND_REFERENCE PHPExcel_Calculation_LookupRef::VLOOKUP
|
||||||
|
|
||||||
WEEKDAY CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::DAYOFWEEK
|
WEEKDAY CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::DAYOFWEEK
|
||||||
WEEKNUM CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::WEEKOFYEAR
|
WEEKNUM CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::WEEKNUM
|
||||||
WEIBULL CATEGORY_STATISTICAL PHPExcel_Calculation_Statistical::WEIBULL
|
WEIBULL CATEGORY_STATISTICAL PHPExcel_Calculation_Statistical::WEIBULL
|
||||||
WORKDAY CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::WORKDAY
|
WORKDAY CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::WORKDAY
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
TIMEVALUE | PHPExcel_Calculation_DateTime::TIMEVALUE
|
TIMEVALUE | PHPExcel_Calculation_DateTime::TIMEVALUE
|
||||||
TODAY | PHPExcel_Calculation_DateTime::DATENOW
|
TODAY | PHPExcel_Calculation_DateTime::DATENOW
|
||||||
WEEKDAY | PHPExcel_Calculation_DateTime::DAYOFWEEK
|
WEEKDAY | PHPExcel_Calculation_DateTime::DAYOFWEEK
|
||||||
WEEKNUM | PHPExcel_Calculation_DateTime::WEEKOFYEAR
|
WEEKNUM | PHPExcel_Calculation_DateTime::WEEKNUM
|
||||||
WORKDAY | PHPExcel_Calculation_DateTime::WORKDAY
|
WORKDAY | PHPExcel_Calculation_DateTime::WORKDAY
|
||||||
YEAR | PHPExcel_Calculation_DateTime::YEAR
|
YEAR | PHPExcel_Calculation_DateTime::YEAR
|
||||||
YEARFRAC | PHPExcel_Calculation_DateTime::YEARFRAC
|
YEARFRAC | PHPExcel_Calculation_DateTime::YEARFRAC
|
||||||
|
|
|
@ -457,7 +457,7 @@
|
||||||
Excel Function | Category | PHPExcel Function
|
Excel Function | Category | PHPExcel Function
|
||||||
--------------------|--------------------------------|-------------------------------------------
|
--------------------|--------------------------------|-------------------------------------------
|
||||||
WEEKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DAYOFWEEK
|
WEEKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DAYOFWEEK
|
||||||
WEEKNUM | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WEEKOFYEAR
|
WEEKNUM | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WEEKNUM
|
||||||
WEIBULL | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::WEIBULL
|
WEIBULL | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::WEIBULL
|
||||||
WORKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WORKDAY
|
WORKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WORKDAY
|
||||||
|
|
||||||
|
|
|
@ -1965,7 +1965,7 @@ class Calculation
|
||||||
],
|
],
|
||||||
'WEEKNUM' => [
|
'WEEKNUM' => [
|
||||||
'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME,
|
'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME,
|
||||||
'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::WEEKOFYEAR',
|
'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::WEEKNUM',
|
||||||
'argumentCount' => '1,2',
|
'argumentCount' => '1,2',
|
||||||
],
|
],
|
||||||
'WEIBULL' => [
|
'WEIBULL' => [
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ class DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WEEKOFYEAR
|
* WEEKNUM
|
||||||
*
|
*
|
||||||
* Returns the week of the year for a specified date.
|
* Returns the week of the year for a specified date.
|
||||||
* The WEEKNUM function considers the week containing January 1 to be the first week of the year.
|
* The WEEKNUM function considers the week containing January 1 to be the first week of the year.
|
||||||
|
@ -1218,7 +1218,7 @@ class DateTime
|
||||||
* 2 Week begins on Monday.
|
* 2 Week begins on Monday.
|
||||||
* @return int Week Number
|
* @return int Week Number
|
||||||
*/
|
*/
|
||||||
public static function WEEKOFYEAR($dateValue = 1, $method = 1)
|
public static function WEEKNUM($dateValue = 1, $method = 1)
|
||||||
{
|
{
|
||||||
$dateValue = Functions::flattenSingleValue($dateValue);
|
$dateValue = Functions::flattenSingleValue($dateValue);
|
||||||
$method = Functions::flattenSingleValue($method);
|
$method = Functions::flattenSingleValue($method);
|
||||||
|
|
|
@ -145,7 +145,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array([DateTime::class, 'WEEKOFYEAR'], $args);
|
$result = call_user_func_array([DateTime::class, 'WEEKNUM'], $args);
|
||||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue