UNPKG

luxon

Version:
797 lines (485 loc) 22.7 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 {Zone} from &apos;<span><a href="file/src/zone.js.html#lineNumber7">luxon/src/zone.js</a></span>&apos;</code></pre></div> <span data-ice="access">public</span> <span data-ice="kind">interface</span> <span data-ice="source">| <span><a href="file/src/zone.js.html#lineNumber7">source</a></span></span> </div> <div class="self-detail detail"> <h1 data-ice="name">Zone</h1> <div class="flat-list" data-ice="directSubclass"><h4>Direct Subclass:</h4><div><span>src/zones/fixedOffsetZone.js~FixedOffsetZone</span>, <span>src/zones/IANAZone.js~IANAZone</span>, <span>src/zones/localZone.js~LocalZone</span></div></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="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#static-method-offsetName">offsetName</a></span></span><span data-ice="signature">(ts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> </p> </div> <div> <div data-ice="description"><p>Returns the offset&apos;s common name (such as EST) at the specified timestamp</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-get-isValid">isValid</a></span></span><span data-ice="signature">: <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 this Zone is valid.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-get-name">name</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> </p> </div> <div> <div data-ice="description"><p>The name of this zone.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-get-type">type</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> </p> </div> <div> <div data-ice="description"><p>The type of zone</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-get-universal">universal</a></span></span><span data-ice="signature">: <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>Returns whether the offset is known to be fixed for the whole year.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-method-equals">equals</a></span></span><span data-ice="signature">(otherZone: <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 this Zone is equal to another zoner</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="name"><span><a href="class/src/zone.js~Zone.html#instance-method-offset">offset</a></span></span><span data-ice="signature">(ts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></span> </p> </div> <div> <div data-ice="description"><p>Return the offset in minutes for this zone at the specified timestamp.</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-offsetName"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">offsetName</span><span data-ice="signature">(ts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/zone.js.html#lineNumber44">source</a></span></span> </span> </h3> <div data-ice="description"><p>Returns the offset&apos;s common name (such as EST) at the specified timestamp</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">ts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Epoch milliseconds for which to get the name</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" data-depth="0">options</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 to affect the format</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">options.format</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"></td> <td data-ice="description"><p>What style of offset to return. Accepts &apos;long&apos; or &apos;short&apos;.</p> </td> </tr> <tr data-ice="property" data-depth="1"> <td data-ice="name" data-depth="1">options.localeCode</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"></td> <td data-ice="description"><p>What locale to return the offset name in. Defaults to us-en</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/String">string</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> </div> <div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-get-isValid"> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">isValid</span><span data-ice="signature">: <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/zone.js.html#lineNumber73">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return whether this Zone is valid.</p> </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/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="instance-get-name"> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">name</span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/zone.js.html#lineNumber22">source</a></span></span> </span> </h3> <div data-ice="description"><p>The name of this zone.</p> </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/String">string</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-get-type"> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">type</span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/zone.js.html#lineNumber13">source</a></span></span> </span> </h3> <div data-ice="description"><p>The type of zone</p> </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/String">string</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-get-universal"> <span class="access" data-ice="access">public</span> <span class="kind" data-ice="kind">get</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">universal</span><span data-ice="signature">: <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/zone.js.html#lineNumber31">source</a></span></span> </span> </h3> <div data-ice="description"><p>Returns whether the offset is known to be fixed for the whole year.</p> </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/Boolean">boolean</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> </div> <div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-equals"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">equals</span><span data-ice="signature">(otherZone: <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/zone.js.html#lineNumber64">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return whether this Zone is equal to another zoner</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">otherZone</td> <td data-ice="type"><span><a href="class/src/zone.js~Zone.html">Zone</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>the zone to compare</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="instance-method-offset"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="name">offset</span><span data-ice="signature">(ts: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/zone.js.html#lineNumber54">source</a></span></span> </span> </h3> <div data-ice="description"><p>Return the offset in minutes for this zone at the specified timestamp.</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">ts</td> <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Epoch milliseconds for which to compute the offset</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/Number">number</a></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>