summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2017-01-29 15:58:05 +0100
committerEike Rathke <erack@redhat.com>2017-01-30 18:14:46 +0000
commit4b605ca21b15ff4cbd734291e21ab02c5e57c424 (patch)
treefdb5104e81b0a14a44120572566145ca5ab296bd /sc/qa/unit
parentb51be29b8c24294d26706cb2d0fd52c1878768bb (diff)
tdf#105548 fix incorrect DATEDIF result.
DATEDIF didn't convert datetime values to date before calculating date differences, which in certain cases produced incorrect results. Adding use case to unit test document. Removed 'TODO-comment' after checking what Excel really does. Change-Id: Icc16413e43f664d1c993d24e31eb4dc6990623e9 Reviewed-on: https://gerrit.libreoffice.org/33662 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit e7606f1f19b2970f0160075f56d4d97029f1e47a) Reviewed-on: https://gerrit.libreoffice.org/33704
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/functions/fods/datedif.fods31
1 files changed, 29 insertions, 2 deletions
diff --git a/sc/qa/unit/data/functions/fods/datedif.fods b/sc/qa/unit/data/functions/fods/datedif.fods
index 9f13e96684d4..9b09a9bd8535 100644
--- a/sc/qa/unit/data/functions/fods/datedif.fods
+++ b/sc/qa/unit/data/functions/fods/datedif.fods
@@ -2610,6 +2610,33 @@
</table:table-cell>
<table:table-cell table:number-columns-repeated="8"/>
</table:table-row>
+ <table:table-row table:style-name="ro5">
+ <table:table-cell table:formula="of:=DATEDIF([.F112];[.G112];[.H112])" office:value-type="float" office:value="2" calcext:value-type="float">
+ <text:p>2</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float">
+ <text:p>2</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce11" table:formula="of:=[.A112]=[.B112]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+ <text:p>PRAVDA</text:p>
+ </table:table-cell>
+ <table:table-cell table:formula="of:=FORMULA([.A112])" office:value-type="string" office:string-value="=DATEDIF(F112;G112;H112)" calcext:value-type="string">
+ <text:p>=DATEDIF(F112;G112;H112)</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>tdf#105548</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce40" office:value-type="date" office:date-value="2017-01-01T08:00:00" calcext:value-type="date">
+ <text:p>01/01/2017 08:00 AM</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce40" office:value-type="date" office:date-value="2017-01-03T07:00:00" calcext:value-type="date">
+ <text:p>01/03/17 07:00 AM</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>d</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="8"/>
+ </table:table-row>
<table:table-row table:style-name="ro6" table:number-rows-repeated="1048464">
<table:table-cell table:number-columns-repeated="16"/>
</table:table-row>
@@ -2617,7 +2644,7 @@
<table:table-cell table:number-columns-repeated="16"/>
</table:table-row>
<calcext:conditional-formats>
- <calcext:conditional-format calcext:target-range-address="Sheet2.C2:Sheet2.C111">
+ <calcext:conditional-format calcext:target-range-address="Sheet2.C2:Sheet2.C112">
<calcext:condition calcext:apply-style-name="1true" calcext:value="=TRUE()" calcext:base-cell-address="Sheet2.C2"/>
<calcext:condition calcext:apply-style-name="0false" calcext:value="!=TRUE()" calcext:base-cell-address="Sheet2.C2"/>
</calcext:conditional-format>
@@ -2643,4 +2670,4 @@
</table:named-expressions>
</office:spreadsheet>
</office:body>
-</office:document> \ No newline at end of file
+</office:document>