You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
The Excel EOMONTH() and EDATE() functions should always return a float with the date, but with the time truncated to 0.
e.g.
EOMONTH(22269.75, 3) should result in float 22371.0 EDATE(22269.75, 2) should result in float 22331.0
What is the current behavior?
If the dateValue argument to EOMONTH() includes a time, then the result also includes that time.
EOMONTH(22269.75, 3) results in float 22371.75 EDATE(22269.75, 2) results in float 22331.75
<?phprequire__DIR__ . '/vendor/autoload.php';
usePhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Month;
$dateValue = 22269.75;
$adjustment = 3;
$result = Month::lastDay($dateValue, $adjustment);
var_dump($result); // Should be (float) 22371.0 but is (float) 22371.75$dateValue = 22269.75;
$adjustment = 2;
$result = Month::adjust($dateValue, $adjustment);
var_dump($result); // Should be (float) 22331.0 but is (float) 22331.75
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Reader
Writer
Styles
Data Validations
Formula Calculations
Charts
AutoFilter
Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
N/A
Which versions of PhpSpreadsheet and PHP are affected?
All
The text was updated successfully, but these errors were encountered:
MarkBaker
changed the title
EOMONTH should round date value before evaluation
EOMONTH() Function implementation should round date value before evaluation
Mar 6, 2023
MarkBaker
changed the title
EOMONTH() Function implementation should round date value before evaluation
EOMONTH() and EDATE() Functions should round date value before evaluation
Mar 6, 2023
This is:
What is the expected behavior?
The Excel
EOMONTH()
andEDATE()
functions should always return a float with the date, but with the time truncated to 0.e.g.
What is the current behavior?
If the
dateValue
argument toEOMONTH()
includes a time, then the result also includes that time.What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
N/A
Which versions of PhpSpreadsheet and PHP are affected?
All
The text was updated successfully, but these errors were encountered: