From c1ceff53b1e8f453a4451616a1ddcb49460dfca6 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 8 Jan 2016 11:24:40 +0100 Subject: tdf#85433 help content for WEEKNUM, ISOWEEKNUM, WEEKNUM_EXCEL2003, WEEKNUM_OOO Change-Id: I92995b4de6fe18d981757f0d273ddce5c11b1559 (cherry picked from commit 71a3f0e66fb6fb37f73fe3841a36ba00bec5beaa) Reviewed-on: https://gerrit.libreoffice.org/21248 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- AllLangHelp_scalc.mk | 2 ++ source/text/scalc/01/04060102.xhp | 12 +++++++- source/text/scalc/01/func_isoweeknum.xhp | 46 ++++++++++++++++++++++++++++ source/text/scalc/01/func_weeknum.xhp | 29 +++++++++++++----- source/text/scalc/01/func_weeknum_ooo.xhp | 51 +++++++++++++++++++++++++++++++ source/text/scalc/01/func_weeknumadd.xhp | 14 ++++----- 6 files changed, 138 insertions(+), 16 deletions(-) create mode 100644 source/text/scalc/01/func_isoweeknum.xhp create mode 100644 source/text/scalc/01/func_weeknum_ooo.xhp diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk index 975c527b18..efce3956fe 100644 --- a/AllLangHelp_scalc.mk +++ b/AllLangHelp_scalc.mk @@ -207,6 +207,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\ helpcontent2/source/text/scalc/01/func_imsin \ helpcontent2/source/text/scalc/01/func_imsinh \ helpcontent2/source/text/scalc/01/func_imtan \ + helpcontent2/source/text/scalc/01/func_isoweeknum \ helpcontent2/source/text/scalc/01/func_minute \ helpcontent2/source/text/scalc/01/func_month \ helpcontent2/source/text/scalc/01/func_networkdays \ @@ -220,6 +221,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\ helpcontent2/source/text/scalc/01/func_weekday \ helpcontent2/source/text/scalc/01/func_webservice \ helpcontent2/source/text/scalc/01/func_weeknum \ + helpcontent2/source/text/scalc/01/func_weeknum_ooo \ helpcontent2/source/text/scalc/01/func_weeknumadd \ helpcontent2/source/text/scalc/01/func_workday \ helpcontent2/source/text/scalc/01/func_year \ diff --git a/source/text/scalc/01/04060102.xhp b/source/text/scalc/01/04060102.xhp index db41ffd403..9ff462d83a 100644 --- a/source/text/scalc/01/04060102.xhp +++ b/source/text/scalc/01/04060102.xhp @@ -38,7 +38,7 @@
-The functions whose names end with _ADD return the same results as the corresponding Microsoft Excel functions. Use the functions without _ADD to get results based on international standards. For example, the WEEKNUM function calculates the week number of a given date based on international standard ISO 8601, while WEEKNUM_ADD returns the same week number as Microsoft Excel.UFI: see #33784# +The functions whose names end with _ADD or _EXCEL2003 return the same results as the corresponding Microsoft Excel 2003 functions without the suffix. Use the functions without suffix to get results based on international standards.
$[officename] internally handles a date/time value as a numerical value. If you assign the numbering format "Number" to a date or time value, it is converted to a number. For example, 01/01/2000 12:00 PM, converts to 36526.5. The value preceding the decimal point corresponds to the date; the value following the decimal point corresponds to the time. If you do not want to see this type of numerical date or time representation, change the number format (date or time) accordingly. To do this, select the cell containing the date or time value, call its context menu and select Format Cells. The Numbers tab page contains the functions for defining the number format. Date base for day zero @@ -130,11 +130,21 @@ +
+ + + +
+
+ + + +
diff --git a/source/text/scalc/01/func_isoweeknum.xhp b/source/text/scalc/01/func_isoweeknum.xhp new file mode 100644 index 0000000000..3e283be911 --- /dev/null +++ b/source/text/scalc/01/func_isoweeknum.xhp @@ -0,0 +1,46 @@ + + + + + + + + + + +ISOWEEKNUM +/text/scalc/01/func_isoweeknum.xhp + + + +ISOWEEKNUM function + +ISOWEEKNUM + +ISOWEEKNUM calculates the week number of the year for the internal date value. +The International Standard ISO 8601 has decreed that Monday shall be the first day of the week. A week that lies partly in one year and partly in another is assigned a number in the year in which most of its days lie. That means that week number 1 of any year is the week that contains the January 4th. +Syntax +ISOWEEKNUM(Number) + +Number is the internal date number. +Examples +=ISOWEEKNUM(DATE(1995;1;1)) returns 52. Week 1 starts on Monday, 1995-01-02. +=ISOWEEKNUM(DATE(1999;1;1)) returns 53. Week 1 starts on Monday, 1999-01-04. + + diff --git a/source/text/scalc/01/func_weeknum.xhp b/source/text/scalc/01/func_weeknum.xhp index 58d1f9346d..a19848ff15 100644 --- a/source/text/scalc/01/func_weeknum.xhp +++ b/source/text/scalc/01/func_weeknum.xhp @@ -33,18 +33,31 @@ WEEKNUM -WEEKNUM calculates the week number of the year for the internal date value. -The International Standard ISO 8601 has decreed that Monday shall be the first day of the week. A week that lies partly in one year and partly in another is assigned a number in the year in which most of its days lie. That means that week number 1 of any year is the week that contains the January 4th. +WEEKNUM calculates the week number of the year for the internal date value as defined in ODF OpenFormula and compatible with other spreadsheet applications. +Supported are two week numbering systems: +System 1: The week containing January 1 is the first week of the year, and is numbered week 1. +System 2: The week containing the first Thursday of the year is the first week of the year, and is numbered week 1. That means that week number 1 of any year is the week that contains January 4th. ISO 8601 defines this system and that the week starts on Monday. Syntax -WEEKNUM(Number; Mode) +WEEKNUM(Number [; Mode]) Number is the internal date number. -Mode sets the start of the week and the calculation type. -1 = Sunday -2 = Monday +Mode sets the start of the week and the week numbering system. This parameter is optional, if omitted the default value is 1. +1 = Sunday, system 1 +2 = Monday, system 1 +11 = Monday, system 1 +12 = Tuesday, system 1 +13 = Wednesday, system 1 +14 = Thursday, system 1 +15 = Friday, system 1 +16 = Saturday, system 1 +17 = Sunday, system 1 +21 = Monday, system 2 (ISO 8601) +150 = Monday, system 2 (ISO 8601, for interoperability with Gnumeric) Examples -=WEEKNUM("1995-01-01";1) returns 1 -=WEEKNUM("1995-01-01";2) returns 52. If the week starts on Monday, Sunday belongs to the last week of the previous year. +=WEEKNUM(DATE(1995;1;1);1) returns 1 +=WEEKNUM(DATE(1995;1;1);2) returns 52. If the week starts on Monday, Sunday belongs to the last week of the previous year. +=WEEKNUM(DATE(1995;1;1);21) returns 52. Week 1 starts on Monday, 1995-01-02. +=WEEKNUM(DATE(1999;1;1);21) returns 53. Week 1 starts on Monday, 1999-01-04. diff --git a/source/text/scalc/01/func_weeknum_ooo.xhp b/source/text/scalc/01/func_weeknum_ooo.xhp new file mode 100644 index 0000000000..bbc14b6b11 --- /dev/null +++ b/source/text/scalc/01/func_weeknum_ooo.xhp @@ -0,0 +1,51 @@ + + + + + + + + + + +WEEKNUM_OOO +/text/scalc/01/func_weeknum_ooo.xhp + + + +WEEKNUM_OOO function + +WEEKNUM_OOO + +WEEKNUM_OOO calculates the week number of the year for the internal date value. +This function exists for interoperability with LibreOffice releases older than 5.1.0 and OpenOffice.org. It calculates week numbers for a week numbering system in that week number 1 is the week that contains the January 4th. This function does not provide interoperability with other spreadsheet applications. For new documents use the WEEKNUM or ISOWEEKNUM function instead. +Syntax +WEEKNUM_OOO(Number; Mode) + +Number is the internal date number. + +Mode sets the start of the week and the calculation type. +1 = Sunday +2 = Monday (ISO 8601) +any other value = Monday (ISO 8601) +Examples +=WEEKNUM_OOO(DATE(1995;1;1);1) returns 1 +=WEEKNUM_OOO(DATE(1995;1;1);2) returns 52. Week 1 starts on Monday, 1995-01-02. + + diff --git a/source/text/scalc/01/func_weeknumadd.xhp b/source/text/scalc/01/func_weeknumadd.xhp index 4c46437777..de257e6a06 100644 --- a/source/text/scalc/01/func_weeknumadd.xhp +++ b/source/text/scalc/01/func_weeknumadd.xhp @@ -24,26 +24,26 @@ -WEEKNUM_ADD +WEEKNUM_EXCEL2003 /text/scalc/01/func_weeknumadd.xhp -WEEKNUM_ADD function +WEEKNUM_EXCEL2003 function -WEEKNUM_ADD +WEEKNUM_EXCEL2003 The result indicates the number of the calendar week for a date. -The WEEKNUM_ADD function is designed to calculate week numbers exactly as Microsoft Excel does. Use the WEEKNUM function, or format your date cells using the WW formatting code, when you need ISO 8601 week numbers. +The WEEKNUM_EXCEL2003 function is designed to calculate week numbers exactly as Microsoft Excel 2003 did. Use the WEEKNUM function for ODF OpenFormula and Excel 2010 compatibility, or ISOWEEKNUM function when you just need ISO 8601 week numbers. In releases prior to $[officename] 5.1 WEEKNUM_EXCEL2003 was named WEEKNUM_ADD. Syntax -WEEKNUM_ADD(Date; ReturnType) +WEEKNUM_EXCEL2003(Date; ReturnType) Date is the date within the calendar week. ReturnType is 1 for week beginning on a Sunday, 2 for week beginning on a Monday. Example -In which week number does 12.24.2001 fall? +In which week number does 12/24/2001 fall? -=WEEKNUM_ADD(24.12.2001;1) returns 52. +=WEEKNUM_EXCEL2003(DATE(2001;12;24);1) returns 52. -- cgit