summaryrefslogtreecommitdiffstats
path: root/3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html')
-rw-r--r--3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html b/3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html
new file mode 100644
index 000000000..d6e77d81f
--- /dev/null
+++ b/3rdparty/js/angular-1.0.2/docs/partials/api/angular.mock.TzDate.html
@@ -0,0 +1,40 @@
+<h1><code ng:non-bindable="">angular.mock.TzDate</code>
+<span class="hint">(API in module <code ng:non-bindable="">ng</code>
+)</span>
+</h1>
+<div><h2 id="Description">Description</h2>
+<div class="description"><p><em>NOTE</em>: this is not an injectable instance, just a globally available mock class of <code>Date</code>.</p>
+
+<p>Mock of the Date type which has its timezone specified via constroctor arg.</p>
+
+<p>The main purpose is to create Date-like instances with timezone fixed to the specified timezone
+offset, so that we can test code that depends on local timezone settings without dependency on
+the time zone settings of the machine where the code is running.</p></div>
+<h2 id="Usage">Usage</h2>
+<div class="usage"><pre class="prettyprint linenums">TzDate(offset, timestamp);</pre>
+<h3 id="Parameters">Parameters</h3>
+<ul class="parameters"><li><code ng:non-bindable="">offset – {number} – </code>
+<p>Offset of the <em>desired</em> timezone in hours (fractions will be honored)</p></li>
+<li><code ng:non-bindable="">timestamp – {(number|string)} – </code>
+<p>Timestamp representing the desired time in <em>UTC</em></p></li>
+</ul>
+</div>
+<h2 id="Example">Example</h2>
+<div class="example"><p>!!!! WARNING !!!!!
+This is not a complete Date object so only methods that were implemented can be called safely.
+To make matters worse, TzDate instances inherit stuff from Date via a prototype.</p>
+
+<p>We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
+incomplete we might be missing some non-standard methods. This can result in errors like:
+"Date.prototype.foo called on incompatible Object".</p>
+
+<pre class="prettyprint linenums">
+var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
+newYearInBratislava.getTimezoneOffset() =&gt; -60;
+newYearInBratislava.getFullYear() =&gt; 2010;
+newYearInBratislava.getMonth() =&gt; 0;
+newYearInBratislava.getDate() =&gt; 1;
+newYearInBratislava.getHours() =&gt; 0;
+newYearInBratislava.getMinutes() =&gt; 0;
+</pre></div>
+</div>