Skip to content

Commit

Permalink
Version 1.19.0: made Period clonable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogier Schouten committed Apr 2, 2015
1 parent 34ac43a commit 39251ed
Show file tree
Hide file tree
Showing 16 changed files with 191 additions and 48 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ The version of the included IANA time zone database is 2015b.

## Changelog

### 1.19.0 (2015-04-02)
* Made Period cloneable by adding a clone() method

### 1.18.0 (2015-04-01)
* Add DateTime#startOfMonth() which returns the date truncated to the first day of the month at 00:00:00
* Add DateTime#startOfYear() which returns the date truncated to the first day of the year at 00:00:00
Expand Down
13 changes: 13 additions & 0 deletions dist/timezonecomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -3012,6 +3012,12 @@ var Period = (function () {
}
}
}
/**
* Return a fresh copy of the period
*/
Period.prototype.clone = function () {
return new Period(this._start, this._interval, this._dst);
};
/**
* The start date
*/
Expand Down Expand Up @@ -3774,6 +3780,13 @@ var TimeZone = (function () {
}
return TimeZone._findOrCreate(name, dst);
};
/**
* Makes this class appear clonable. NOTE as time zone objects are cached you will NOT
* actually get a clone but the same object.
*/
TimeZone.prototype.clone = function () {
return this;
};
/**
* The time zone identifier. Can be an offset "-01:30" or an
* IANA time zone name "Europe/Amsterdam", or "localtime" for
Expand Down
2 changes: 1 addition & 1 deletion doc/assets/js/search.js

Large diffs are not rendered by default.

62 changes: 44 additions & 18 deletions doc/classes/_period_.period.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h3>Methods</h3>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="_period_.period.html#_dstrelevant" class="tsd-kind-icon">_dst<wbr>Relevant</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="_period_.period.html#_normalizeday" class="tsd-kind-icon">_normalize<wbr>Day</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_period_.period.html#amount" class="tsd-kind-icon">amount</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_period_.period.html#clone" class="tsd-kind-icon">clone</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_period_.period.html#dst" class="tsd-kind-icon">dst</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_period_.period.html#equals" class="tsd-kind-icon">equals</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_period_.period.html#findfirst" class="tsd-kind-icon">find<wbr>First</a></li>
Expand Down Expand Up @@ -354,7 +355,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _calc<wbr>Internal<wbr>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:758</li>
<li>Defined in period.ts:765</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -380,7 +381,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _correct<wbr>Day</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:713</li>
<li>Defined in period.ts:720</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -408,7 +409,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _dst<wbr>Relevant</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:745</li>
<li>Defined in period.ts:752</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -431,7 +432,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _normalize<wbr>Day</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:728</li>
<li>Defined in period.ts:735</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -464,7 +465,7 @@ <h3>amount</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:235</li>
<li>Defined in period.ts:242</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -477,6 +478,28 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</s
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="clone" class="tsd-anchor"></a>
<h3>clone</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<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="_period_.period.html" class="tsd-signature-type">Period</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:220</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Return a fresh copy of the period</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <a href="_period_.period.html" class="tsd-signature-type">Period</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="dst" class="tsd-anchor"></a>
<h3>dst</h3>
Expand All @@ -487,7 +510,7 @@ <h3>dst</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:250</li>
<li>Defined in period.ts:257</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -509,7 +532,7 @@ <h3>equals</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:664</li>
<li>Defined in period.ts:671</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -539,7 +562,7 @@ <h3>find<wbr>First</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:262</li>
<li>Defined in period.ts:269</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -571,7 +594,7 @@ <h3>find<wbr>Next</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:617</li>
<li>Defined in period.ts:624</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -612,7 +635,7 @@ <h3>find<wbr>Prev</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:642</li>
<li>Defined in period.ts:649</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -649,7 +672,7 @@ <h3>identical</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:674</li>
<li>Defined in period.ts:681</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -677,7 +700,7 @@ <h3>inspect</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:706</li>
<li>Defined in period.ts:713</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -699,7 +722,7 @@ <h3>interval</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:227</li>
<li>Defined in period.ts:234</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -721,7 +744,7 @@ <h3>is<wbr>Boundary</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:650</li>
<li>Defined in period.ts:657</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -750,7 +773,7 @@ <h3>start</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:220</li>
<li>Defined in period.ts:227</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -772,7 +795,7 @@ <h3>to<wbr>Iso<wbr>String</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:686</li>
<li>Defined in period.ts:693</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -797,7 +820,7 @@ <h3>to<wbr>String</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:694</li>
<li>Defined in period.ts:701</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -820,7 +843,7 @@ <h3>unit</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in period.ts:243</li>
<li>Defined in period.ts:250</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -931,6 +954,9 @@ <h4 class="tsd-returns-title">Returns <a href="../enums/_basics_.timeunit.html"
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_period_.period.html#amount" class="tsd-kind-icon">amount</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_period_.period.html#clone" class="tsd-kind-icon">clone</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_period_.period.html#dst" class="tsd-kind-icon">dst</a>
</li>
Expand Down
Loading

0 comments on commit 39251ed

Please sign in to comment.