UNPKG

jsdk-offical

Version:

JSDK is the most comprehensive TypeScript framework, like JDK.

727 lines (719 loc) 42.3 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Date | JSDK 2.7.0 API</title> <meta name="description" content="Documentation for JSDK 2.7.0 API"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">JSDK 2.7.0 API</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="date.html">Date</a> </li> </ul> <h1>Interface Date</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Add some helpful methods for Date.prototype</p> </div> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">Date</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#add" class="tsd-kind-icon">add</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#between" class="tsd-kind-icon">between</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#clone" class="tsd-kind-icon">clone</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#diff" class="tsd-kind-icon">diff</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#equals" class="tsd-kind-icon">equals</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#format" class="tsd-kind-icon">format</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#formattimezoneoffset" class="tsd-kind-icon">format<wbr>Timezone<wbr>Offset</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#getweek" class="tsd-kind-icon">get<wbr>Week</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#isafter" class="tsd-kind-icon">is<wbr>After</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#isbefore" class="tsd-kind-icon">is<wbr>Before</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#istoday" class="tsd-kind-icon">is<wbr>Today</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#set" class="tsd-kind-icon">set</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#setlasttime" class="tsd-kind-icon">set<wbr>Last<wbr>Time</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#setnowtime" class="tsd-kind-icon">set<wbr>Now<wbr>Time</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#settimezoneoffset" class="tsd-kind-icon">set<wbr>Timezone<wbr>Offset</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#setweek" class="tsd-kind-icon">set<wbr>Week</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="date.html#setzerotime" class="tsd-kind-icon">set<wbr>Zero<wbr>Time</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="add" class="tsd-anchor"></a> <h3>add</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">add<span class="tsd-signature-symbol">(</span>v<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ms"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"s"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"m"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"h"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"d"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"w"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"M"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"y"</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Adds value to this date by millisecond | second | minute | hour | day | week | month | year</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>v: <span class="tsd-signature-type">number</span></h5> </li> <li> <h5>type: <span class="tsd-signature-type">"ms"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"s"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"m"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"h"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"d"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"w"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"M"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"y"</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="between" class="tsd-anchor"></a> <h3>between</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">between<span class="tsd-signature-symbol">(</span>start<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a>, end<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Determines if this instance is between a range of two dates or equal to either the start or end dates.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>start: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>Start of range [Required]</p> </div> </li> <li> <h5>end: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>End of range [Required]</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>true is this is between or equal to the start and end dates, else false</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="clone" class="tsd-anchor"></a> <h3>clone</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">clone<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns a new Date object that is an exact date and time copy of the original instance.</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> <p>A new Date instance</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="diff" class="tsd-anchor"></a> <h3>diff</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">diff<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">?: </span><a href="date.html" class="tsd-signature-type">Date</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns the number of milliseconds between this date and date.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> date: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>Defaults to now</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>The diff in milliseconds</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="equals" class="tsd-anchor"></a> <h3>equals</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">equals<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a>, type<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">"ms"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"s"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"m"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"h"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"d"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"w"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"M"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"y"</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Compares this instance to another Date object and returns true if they are equal.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>date: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>Date object to compare. If no date to compare, new Date() [now] is used.</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <span class="tsd-signature-type">"ms"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"s"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"m"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"h"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"d"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"w"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"M"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"y"</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>true if dates are equal. false if they are not equal.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="format" class="tsd-anchor"></a> <h3>format</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">format<span class="tsd-signature-symbol">(</span>format<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, locale<span class="tsd-signature-symbol">?: </span><a href="../modules/js.util.html#locale" class="tsd-signature-type">Locale</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Converts the value of the current Date object to its equivalent string representation.</p> </div> <p>Format Specifiers:</p> <pre> https://www.w3.org/TR/NOTE-datetime https://www.ietf.org/rfc/rfc3339.txt </pre> <p>Formats:</p> <pre> Format Description Example ------ ------------------------------------------------------- ---------------- s The seconds of the minute between 0-59. "0" to "59" ss The seconds of the minute with leading zero if required. "00" to "59" m The minute of the hour between 0-59. "0" or "59" mm The minute of the hour with leading zero if required. "00" or "59" h The hour of the day between 1-12. "1" to "12" hh The hour of the day with leading zero if required. "01" to "12" H The hour of the day between 0-23. "0" to "23" HH The hour of the day with leading zero if required. "00" to "23" ddd Abbreviated week day name. "Mon" to "Sun" dddd The full week day name. "Monday" to "Sunday" D The day of the month between 1 and 31. "1" to "31" DD The day of the month with leading zero if required. "01" to "31" M The month of the year between 1-12. "1" to "12" MM The month of the year with leading zero if required. "01" to "12" MMM Abbreviated month name. "Jan" to "Dec" MMMM The full month name. "January" to "December" YY The year as a two-digit number. "99" or "08" YYYY The full four digit year. "1999" or "2008" A AM or PM "AM" or "PM" </pre> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> format: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>A format string. The default value is: &#39;YYYY-MM-DD HH:mm:ss&#39;.</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> locale: <a href="../modules/js.util.html#locale" class="tsd-signature-type">Locale</a></h5> <div class="tsd-comment tsd-typography"> <p>A local string like {language}-{country}.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4> <p>A string representation of the current Date object.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="formattimezoneoffset" class="tsd-anchor"></a> <h3>format<wbr>Timezone<wbr>Offset</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">format<wbr>Timezone<wbr>Offset<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the timezone offset string of the date.</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4> <p>The 4-character offset string prefixed with + or - (e.g. &quot;-0500&quot;)</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="getweek" class="tsd-anchor"></a> <h3>get<wbr>Week</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">get<wbr>Week<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>1~53</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="isafter" class="tsd-anchor"></a> <h3>is<wbr>After</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">is<wbr>After<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Determines if this date occurs after the date to compare to.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>date: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>Date object to compare. If no date to compare, new Date() (&quot;now&quot;) is used.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>true if this date instance is greater than the date to compare to (or &quot;now&quot;), otherwise false.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="isbefore" class="tsd-anchor"></a> <h3>is<wbr>Before</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">is<wbr>Before<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Determines if this date occurs before the date to compare to.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>date: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> <p>Date object to compare. If no date to compare, new Date() (&quot;now&quot;) is used.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>true if this date instance is less than the date to compare to (or &quot;now&quot;).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="istoday" class="tsd-anchor"></a> <h3>is<wbr>Today</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">is<wbr>Today<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>if this date instance is &#39;today&#39;, otherwise false.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>date: <a href="date.html" class="tsd-signature-type">Date</a></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="set" class="tsd-anchor"></a> <h3>set</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<span class="tsd-signature-symbol">(</span>config<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>day<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>hour<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>millisecond<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minute<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>month<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>second<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>timezoneOffset<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>week<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>year<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Sets new value to this date on millisecond | second | minute | hour | day | week | month | year | timezoneOffset</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>config: <span class="tsd-signature-symbol">{ </span>day<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>hour<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>millisecond<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minute<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>month<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>second<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>timezoneOffset<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>week<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>year<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5> <div class="tsd-comment tsd-typography"> </div> <ul class="tsd-parameters"> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> day<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> hour<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> millisecond<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> minute<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> month<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> second<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> timezone<wbr>Offset<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> week<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> year<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> </ul> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="setlasttime" class="tsd-anchor"></a> <h3>set<wbr>Last<wbr>Time</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<wbr>Last<wbr>Time<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Resets the time of this Date object to 23:59:59:999, which is the end of the day.</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> <p>this</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="setnowtime" class="tsd-anchor"></a> <h3>set<wbr>Now<wbr>Time</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<wbr>Now<wbr>Time<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Resets the time of this Date object to the current time (&#39;now&#39;).</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> <p>this</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="settimezoneoffset" class="tsd-anchor"></a> <h3>set<wbr>Timezone<wbr>Offset</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<wbr>Timezone<wbr>Offset<span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Sets new timezone offset(Minutes) to this date.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>offset: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="setweek" class="tsd-anchor"></a> <h3>set<wbr>Week</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<wbr>Week<span class="tsd-signature-symbol">(</span>week<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, dayOfWeek<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">2</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">3</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">4</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">5</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">6</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Moves the date to the week set. Week one (1) is the week which contains the first day of the year.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>week: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>A Number (1 to 53) that represents the week of the year.</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> dayOfWeek: <span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">2</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">3</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">4</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">5</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">6</span></h5> <div class="tsd-comment tsd-typography"> <p>0 is Sunday, Defaults is 1.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> <p>this</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="setzerotime" class="tsd-anchor"></a> <h3>set<wbr>Zero<wbr>Time</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">set<wbr>Zero<wbr>Time<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="date.html" class="tsd-signature-type">Date</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Resets the time of this Date object to 00:00:00:000, which is the start of the day.</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="date.html" class="tsd-signature-type">Date</a></h4> <p>this</p> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-interface"> <a href="date.html" class="tsd-kind-icon">Date</a> <ul> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#add" class="tsd-kind-icon">add</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#between" class="tsd-kind-icon">between</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#clone" class="tsd-kind-icon">clone</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#diff" class="tsd-kind-icon">diff</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#equals" class="tsd-kind-icon">equals</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#format" class="tsd-kind-icon">format</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#formattimezoneoffset" class="tsd-kind-icon">format<wbr>Timezone<wbr>Offset</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#getweek" class="tsd-kind-icon">get<wbr>Week</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#isafter" class="tsd-kind-icon">is<wbr>After</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#isbefore" class="tsd-kind-icon">is<wbr>Before</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#istoday" class="tsd-kind-icon">is<wbr>Today</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#set" class="tsd-kind-icon">set</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#setlasttime" class="tsd-kind-icon">set<wbr>Last<wbr>Time</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#setnowtime" class="tsd-kind-icon">set<wbr>Now<wbr>Time</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#settimezoneoffset" class="tsd-kind-icon">set<wbr>Timezone<wbr>Offset</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#setweek" class="tsd-kind-icon">set<wbr>Week</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="date.html#setzerotime" class="tsd-kind-icon">set<wbr>Zero<wbr>Time</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> </ul> </div> </div> </footer> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>