Преглед на файлове

Merge pull request #11109 from JamesDeFabia/_HPCC-19437DocDateFunctions

HPCC-19437 Docs Std.Date.YearWeekNumFromDate & MonthWeekNumFromDate

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman преди 7 години
родител
ревизия
e5a2183cb4

+ 64 - 0
docs/EN_US/ECLStandardLibraryReference/SLR-Mods/MonthWeekNumFromDate.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="MonthWeekNumFromDate">
+  <title>MonthWeekNumFromDate</title>
+
+  <para><emphasis role="bold">STD.Date.MonthWeekNumFromDate<indexterm>
+      <primary>STD.MonthWeekNumFromDate</primary>
+    </indexterm><indexterm>
+      <primary>MonthWeekNumFromDate</primary>
+    </indexterm>(</emphasis> <emphasis role="bold">date,
+  startingDayOfWeek)</emphasis></para>
+
+  <informaltable colsep="1" frame="all" rowsep="1">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>date</emphasis></entry>
+
+          <entry>The date (in Date_t format) for which to compute the week
+          number.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>startingDayOfWeek</emphasis></entry>
+
+          <entry>Optional, The index number of the first day of a week, 1-7,
+          where 1 = Sunday. Default is 1.</entry>
+        </row>
+
+        <row>
+          <entry>Return:</entry>
+
+          <entry>The 1-based week number of the date, relative to the
+          beginning of the date's month.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para>The <emphasis role="bold">WeekNumFromDate </emphasis> function returns
+  the 1-based week number of a date within the date's month. Week 1 always
+  contains the first day of the month, and week 2 begins on the following day
+  of the week indicated by the value of
+  <emphasis>startingDayOfWeek</emphasis>. </para>
+
+  <para>This is not an ISO-8601 implementation of computing week numbers
+  ("week dates").</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">IMPORT STD;
+startDate := STD.Date.Today();
+weekNum := STD.Date.MonthWeekNumFromDate(startDate,2);
+weekNum;
+</programlisting>
+
+  <para>See Also: <link
+  linkend="YearWeekNumFromDate">YearWeekNumFromDate</link></para>
+</sect1>

+ 64 - 0
docs/EN_US/ECLStandardLibraryReference/SLR-Mods/YearWeekNumFromDate.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="YearWeekNumFromDate">
+  <title>YearWeekNumFromDate</title>
+
+  <para><emphasis role="bold">STD.Date.YearWeekNumFromDate<indexterm>
+      <primary>STD.YearWeekNumFromDate</primary>
+    </indexterm><indexterm>
+      <primary>YearWeekNumFromDate</primary>
+    </indexterm>(</emphasis> <emphasis role="bold">date,
+  startingDayOfWeek)</emphasis></para>
+
+  <informaltable colsep="1" frame="all" rowsep="1">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>date</emphasis></entry>
+
+          <entry>The date (in Date_t format) for which to compute the week
+          number.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>startingDayOfWeek</emphasis></entry>
+
+          <entry>Optional, The index number of the first day of a week, 1-7,
+          where 1 = Sunday. Default is 1.</entry>
+        </row>
+
+        <row>
+          <entry>Return:</entry>
+
+          <entry>The 1-based week number of the date, relative to the
+          beginning of the date's year.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para> The <emphasis role="bold">YearWeekNumFromDate </emphasis> function
+  returns the 1-based week number of a date within the date's year. Week 1
+  always contains the first day of the year, and week 2 begins on the
+  following day of the week indicated by the value of
+  <emphasis>startingDayOfWeek</emphasis>. </para>
+
+  <para>This is not an ISO-8601 implementation of computing week numbers
+  ("week dates").</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">IMPORT STD;
+startDate := STD.Date.Today();
+weekNum := STD.Date.YearWeekNumFromDate(startDate,2);
+weekNum;
+</programlisting>
+
+  <para>See Also: <link
+  linkend="MonthWeekNumFromDate">MonthWeekNumFromDate</link></para>
+</sect1>

+ 7 - 0
docs/EN_US/ECLStandardLibraryReference/SLR-includer.xml

@@ -455,6 +455,13 @@
 
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/AdjustCalendar.xml"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/MonthWeekNumFromDate.xml"
+                xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/YearWeekNumFromDate.xml"
+                xmlns:xi="http://www.w3.org/2001/XInclude" />
+
   </chapter>
 
   <chapter id="Cluster_Handling">