<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to calculate the week number of a date in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1218064#M45113</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/545308"&gt;@JavierCMartínezPrieto&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using the mobile app, go with format-date as shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IsmaelChivite_0-1664582956934.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52677i30BB07D30001EE80/image-size/large?v=v2&amp;amp;px=999" role="button" title="IsmaelChivite_0-1664582956934.png" alt="IsmaelChivite_0-1664582956934.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ISOWek.gif" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52678i09B5BACF9F24118D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ISOWek.gif" alt="ISOWek.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately format-date %W is not supported in the web app. If you want this to work in the web app you will need to use a custom JS function. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function ISO8601_week_no(unix_timestamp) 
  {
     var dt = new Date(unix_timestamp);
     var tdt = new Date(dt.valueOf());
     var dayn = (dt.getDay() + 6) % 7;
     tdt.setDate(tdt.getDate() - dayn + 3);
     var firstThursday = tdt.valueOf();
     tdt.setMonth(0, 1);
     if (tdt.getDay() !== 4) 
       {
      tdt.setMonth(0, 1 + ((4 - tdt.getDay()) + 7) % 7);
        }
     return 1 + Math.ceil((firstThursday - tdt) / 604800000);
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are not familiar with custom JS functions. &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/ba-p/898782" target="_blank" rel="noopener"&gt;Check this blog&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Attaching samples&lt;/P&gt;</description>
    <pubDate>Sat, 01 Oct 2022 00:27:57 GMT</pubDate>
    <dc:creator>IsmaelChivite</dc:creator>
    <dc:date>2022-10-01T00:27:57Z</dc:date>
    <item>
      <title>how to calculate the week number of a date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1217824#M45099</link>
      <description>&lt;P&gt;I would like to know if it is possible to calculate the number of the week from a date using today() in the calculation field.&lt;BR /&gt;I have tried the format-date with the %W operator, but it doesn't work.....&lt;/P&gt;&lt;P&gt;thanks to all of you who participate.&lt;/P&gt;&lt;P&gt;Regards Javier&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 11:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1217824#M45099</guid>
      <dc:creator>JavierCMartínezPrieto</dc:creator>
      <dc:date>2022-09-30T11:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the week number of a date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1217852#M45101</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#week" target="_blank"&gt;Date Functions | ArcGIS Arcade | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Week(Today())&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 30 Sep 2022 12:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1217852#M45101</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-09-30T12:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the week number of a date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1218064#M45113</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/545308"&gt;@JavierCMartínezPrieto&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using the mobile app, go with format-date as shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IsmaelChivite_0-1664582956934.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52677i30BB07D30001EE80/image-size/large?v=v2&amp;amp;px=999" role="button" title="IsmaelChivite_0-1664582956934.png" alt="IsmaelChivite_0-1664582956934.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ISOWek.gif" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52678i09B5BACF9F24118D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ISOWek.gif" alt="ISOWek.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately format-date %W is not supported in the web app. If you want this to work in the web app you will need to use a custom JS function. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function ISO8601_week_no(unix_timestamp) 
  {
     var dt = new Date(unix_timestamp);
     var tdt = new Date(dt.valueOf());
     var dayn = (dt.getDay() + 6) % 7;
     tdt.setDate(tdt.getDate() - dayn + 3);
     var firstThursday = tdt.valueOf();
     tdt.setMonth(0, 1);
     if (tdt.getDay() !== 4) 
       {
      tdt.setMonth(0, 1 + ((4 - tdt.getDay()) + 7) % 7);
        }
     return 1 + Math.ceil((firstThursday - tdt) / 604800000);
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are not familiar with custom JS functions. &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/ba-p/898782" target="_blank" rel="noopener"&gt;Check this blog&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Attaching samples&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 00:27:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1218064#M45113</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2022-10-01T00:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the week number of a date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1218175#M45122</link>
      <description>&lt;P&gt;thank you for answering both of them.&lt;/P&gt;&lt;P&gt;Best regards Javier&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 06:31:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1218175#M45122</guid>
      <dc:creator>JavierCMartínezPrieto</dc:creator>
      <dc:date>2022-10-03T06:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the week number of a date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1302453#M50211</link>
      <description>&lt;P&gt;this is misleading since arcade functions do not work in survey123&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 14:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/m-p/1302453#M50211</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2023-06-23T14:23:49Z</dc:date>
    </item>
  </channel>
</rss>

