UNPKG

luxon

Version:
1,158 lines (780 loc) 39.3 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl" href="../../"> <title data-ice="title">Luxon</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> <link data-ice="userStyle" rel="stylesheet" href="user/css/0-styles.css"> </head> <body class="layout-container" data-ice="rootContainer"> <header><span class="luxon-title">Luxon</span> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <a data-ice="repoURL" href="https://github.com/icambron/luxon" class="repo-url-github">Repository</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> </header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/datetime.js~DateTime.html">DateTime</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/duration.js~Duration.html">Duration</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/info.js~Info.html">Info</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/interval.js~Interval.html">Interval</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/settings.js~Settings.html">Settings</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-interface">I</span><span data-ice="name"><span><a href="class/src/zone.js~Zone.html">Zone</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><div class="header-notice"> <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import {Info} from &apos;<span><a href="file/src/info.js.html#lineNumber9">luxon/src/info.js</a></span>&apos;</code></pre></div> <span data-ice="access">public</span> <span data-ice="kind">class</span> <span data-ice="source">| <span><a href="file/src/info.js.html#lineNumber9">source</a></span></span> </div> <div class="self-detail detail"> <h1 data-ice="name">Info</h1> <div class="description" data-ice="description"><p>The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.</p> </div> </div> <div data-ice="staticMethodSummary"><h2>Static Method Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Static Public Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-eras">eras</a></span></span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of eras, such as [&apos;BC&apos;, &apos;AD&apos;].</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-features">features</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></span> </p> </div> <div> <div data-ice="description"><p>Return the set of available features in this environment.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-hasDST">hasDST</a></span></span><span data-ice="signature">(zone: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="class/src/zone.js~Zone.html">Zone</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span> </p> </div> <div> <div data-ice="description"><p>Return whether the specified zone contains a DST.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-meridiems">meridiems</a></span></span><span data-ice="signature">(opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of meridiems.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-months">months</a></span></span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of standalone month names.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-monthsFormat">monthsFormat</a></span></span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of format month names.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-weekdays">weekdays</a></span></span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of standalone week names.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/info.js~Info.html#static-method-weekdaysFormat">weekdaysFormat</a></span></span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> </p> </div> <div> <div data-ice="description"><p>Return an array of format week names.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="staticMethodDetails"><h2 data-ice="title">Static Public Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-eras"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">eras</span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber125">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of eras, such as [&apos;BC&apos;, &apos;AD&apos;]. The locale can be specified, but the calendar system is always Gregorian.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">length</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;short&apos;</li></ul></td> <td data-ice="description"><p>the length of the era representation, such as &quot;short&quot; or &quot;long&quot;.</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.eras() //=&gt; [ &apos;BC&apos;, &apos;AD&apos; ]</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.eras(&apos;long&apos;) //=&gt; [ &apos;Before Christ&apos;, &apos;Anno Domini&apos; ]</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.eras(&apos;long&apos;, &apos;fr&apos;) //=&gt; [ &apos;avant J&#xE9;sus-Christ&apos;, &apos;apr&#xE8;s J&#xE9;sus-Christ&apos; ]</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-features"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">features</span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber139">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return the set of available features in this environment. Some features of Luxon are not available in all environments. For example, on older browsers, timezone support is not available. Use this function to figure out if that&apos;s the case. Keys:</p> <ul> <li><code>timezones</code>: whether this environment supports IANA timezones</li> <li><code>intlTokens</code>: whether this environment supports internationalized token-based formatting/parsing</li> <li><code>intl</code>: whether this environment supports general internationalization</li> </ul> </div> <div data-ice="properties"> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.feature() //=&gt; { intl: true, intlTokens: false, timezones: true }</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-hasDST"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">hasDST</span><span data-ice="signature">(zone: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="class/src/zone.js~Zone.html">Zone</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber15">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return whether the specified zone contains a DST.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">zone</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="class/src/zone.js~Zone.html">Zone</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;local&apos;</li></ul></td> <td data-ice="description"><p>Zone to check. Defaults to the environment&apos;s local zone.</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-meridiems"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">meridiems</span><span data-ice="signature">(opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber111">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of meridiems.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.meridiems() //=&gt; [ &apos;AM&apos;, &apos;PM&apos; ]</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.meridiems(&apos;de&apos;) //=&gt; [ &apos;vorm.&apos;, &apos;nachm.&apos; ]</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-months"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">months</span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber43">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of standalone month names.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">length</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;long&apos;</li></ul></td> <td data-ice="description"><p>the length of the month representation, such as &quot;numeric&quot;, &quot;2-digit&quot;, &quot;narrow&quot;, &quot;short&quot;, &quot;long&quot;</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.numberingSystem</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: null</li></ul></td> <td data-ice="description"><p>the numbering system</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.outputCalendar</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;gregory&apos;</li></ul></td> <td data-ice="description"><p>the calendar</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months()[0] //=&gt; &apos;January&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months(&apos;short&apos;)[0] //=&gt; &apos;Jan&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months(&apos;numeric&apos;)[0] //=&gt; &apos;1&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months(&apos;short&apos;, { locale: &apos;fr-CA&apos; } )[0] //=&gt; &apos;janv.&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months(&apos;numeric&apos;, { locale: &apos;ar&apos; })[0] //=&gt; &apos;&#x661;&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.months(&apos;long&apos;, { outputCalendar: &apos;islamic&apos; })[0] //=&gt; &apos;Rabi&#x2BB; I&apos;</code></pre> </div> </div> <div data-ice="see"><h4>See:</h4><ul><li><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat</a></span></li></ul></div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-monthsFormat"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">monthsFormat</span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber62">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of format month names. Format months differ from standalone months in that they&apos;re meant to appear next to the day of the month. In some languages, that changes the string. See <span><a href="class/src/duration.js~Duration.html#instance-get-months">months</a></span></p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">length</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;long&apos;</li></ul></td> <td data-ice="description"><p>the length of the month representation, such as &quot;numeric&quot;, &quot;2-digit&quot;, &quot;narrow&quot;, &quot;short&quot;, &quot;long&quot;</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.numbering</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: null</li></ul></td> <td data-ice="description"><p>the numbering system</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.outputCalendar</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;gregory&apos;</li></ul></td> <td data-ice="description"><p>the calendar</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-weekdays"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">weekdays</span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber83">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of standalone week names.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">length</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;long&apos;</li></ul></td> <td data-ice="description"><p>the length of the month representation, such as &quot;narrow&quot;, &quot;short&quot;, &quot;long&quot;.</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.numbering</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: null</li></ul></td> <td data-ice="description"><p>the numbering system</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.outputCalendar</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;gregory&apos;</li></ul></td> <td data-ice="description"><p>the calendar</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.weekdays()[0] //=&gt; &apos;Monday&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.weekdays(&apos;short&apos;)[0] //=&gt; &apos;Mon&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.weekdays(&apos;short&apos;, &apos;fr-CA&apos;)[0] //=&gt; &apos;lun.&apos;</code></pre> </div> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Info.weekdays(&apos;short&apos;, &apos;ar&apos;)[0] //=&gt; &apos;&#x627;&#x644;&#x627;&#x62B;&#x646;&#x64A;&#x646;&apos;</code></pre> </div> </div> <div data-ice="see"><h4>See:</h4><ul><li><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat</a></span></li></ul></div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-weekdaysFormat"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span data-ice="name">weekdaysFormat</span><span data-ice="signature">(length: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, opts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>[string]</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/info.js.html#lineNumber99">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return an array of format week names. Format weekdays differ from standalone weekdays in that they&apos;re meant to appear next to more date information. In some languages, that changes the string. See <span><a href="class/src/info.js~Info.html#static-method-weekdays">weekdays</a></span></p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">length</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;long&apos;</li></ul></td> <td data-ice="description"><p>the length of the month representation, such as &quot;narrow&quot;, &quot;short&quot;, &quot;long&quot;.</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">opts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>options</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.locale</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;en&apos;</li></ul></td> <td data-ice="description"><p>the locale code</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.numbering</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: null</li></ul></td> <td data-ice="description"><p>the numbering system</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">opts.outputCalendar</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: &apos;gregory&apos;</li></ul></td> <td data-ice="description"><p>the calendar</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type" data-ice="returnType"><span>[string]</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> </div> </div> <footer class="footer"> Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a> </footer> <script src="script/search_index.js"></script> <script src="script/search.js"></script> <script src="script/pretty-print.js"></script> <script src="script/inherited-summary.js"></script> <script src="script/test-summary.js"></script> <script src="script/inner-link.js"></script> <script src="script/patch-for-local.js"></script> </body> </html>