mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
1288 lines
77 KiB
HTML
1288 lines
77 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
<title>API: datemath YAHOO.widget.DateMath (YUI Library)</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
|
|
<link rel="stylesheet" type="text/css" href="assets/api.css" />
|
|
|
|
<script type="text/javascript" src="assets/api-js"></script>
|
|
<script type="text/javascript" src="assets/ac-js"></script>
|
|
</head>
|
|
|
|
<body id="yahoo-com">
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="hd">
|
|
<h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
|
|
<h3>datemath <span class="subtitle">2.8.2r1</span></h3>
|
|
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a>
|
|
> <a href="./module_datemath.html" title="datemath">datemath</a>
|
|
> YAHOO.widget.DateMath
|
|
|
|
<form onsubmit="return false">
|
|
<div id="propertysearch">
|
|
Search: <input autocomplete="off" id="searchinput" />
|
|
<div id="searchresults">
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
|
|
<fieldset>
|
|
<legend>Filters</legend>
|
|
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
|
|
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
|
|
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
|
|
</fieldset>
|
|
</form>
|
|
|
|
<h2>
|
|
|
|
|
|
|
|
|
|
Class <b property="yui:name">YAHOO.widget.DateMath</b>
|
|
<span class="extends">
|
|
</span>
|
|
|
|
</h2>
|
|
<!-- class tree goes here -->
|
|
|
|
|
|
|
|
|
|
<div class="summary description" property="yui:description">
|
|
YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
|
|
used for adding, subtracting, and comparing dates.
|
|
</div>
|
|
|
|
|
|
<div rel="yui:properties" resource="#properties">
|
|
<div class="section field details">
|
|
<h3 id="properties">Properties</h3>
|
|
<div class="content">
|
|
<div class="" rel="yui:property" resource="#property_DAY">
|
|
<h4><a name="property_DAY" property="yui:name">DAY</a>
|
|
- <code>static final <span property="yui:type">String</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing Day
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:property" resource="#property_MONTH">
|
|
<h4><a name="property_MONTH" property="yui:name">MONTH</a>
|
|
- <code>static final <span property="yui:type">String</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing Month
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:property" resource="#property_ONE_DAY_MS">
|
|
<h4><a name="property_ONE_DAY_MS" property="yui:name">ONE_DAY_MS</a>
|
|
- <code>static final <span property="yui:type">Number</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing one day, in milliseconds
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:property" resource="#property_WEEK">
|
|
<h4><a name="property_WEEK" property="yui:name">WEEK</a>
|
|
- <code>static final <span property="yui:type">String</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing Week
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:property" resource="#property_WEEK_ONE_JAN_DATE">
|
|
<h4><a name="property_WEEK_ONE_JAN_DATE" property="yui:name">WEEK_ONE_JAN_DATE</a>
|
|
- <code>static <span property="yui:type">Number</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing the date in first week of January
|
|
which identifies the first week of the year.
|
|
<p>
|
|
In the U.S, Jan 1st is normally used based on a Sunday start of week.
|
|
ISO 8601, used widely throughout Europe, uses Jan 4th, based on a Monday start of week.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:property" resource="#property_YEAR">
|
|
<h4><a name="property_YEAR" property="yui:name">YEAR</a>
|
|
- <code>static final <span property="yui:type">String</span></code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description" property="yui:description">
|
|
Constant field representing Year
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div rel="yui:methods" resource="#methods">
|
|
<div class="section method details">
|
|
<h3 id="methods">Methods</h3>
|
|
<div class="content">
|
|
<div class="private" rel="yui:method" resource="#method__addDays">
|
|
<h4>
|
|
<a name="method__addDays">_addDays</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
private
|
|
|
|
|
|
void
|
|
<strong property="yui:name">_addDays</strong>
|
|
(
|
|
|
|
|
|
d
|
|
|
|
|
|
,
|
|
nDays
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Private helper method to account for bug in Safari 2 (webkit < 420)
|
|
when Date.setDate(n) is called with n less than -128 or greater than 127.
|
|
<p>
|
|
Fix approach and original findings are available here:
|
|
http://brianary.blogspot.com/2006/03/safari-date-bug.html
|
|
</p>
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">d</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> JavaScript date object</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">nDays</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The number of days to add to the date object (can be negative)</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_add">
|
|
<h4>
|
|
<a name="method_add">add</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">add</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
field
|
|
|
|
|
|
,
|
|
amount
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Adds the specified amount of time to the this instance.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date object to perform addition on</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">field</span>
|
|
<<span property="yui:type">String</span>>
|
|
</code>
|
|
<span property="yui:description"> The field constant to be used for performing addition.</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">amount</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The number of units (measured in the field constant) to add to the date.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The resulting Date object</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_after">
|
|
<h4>
|
|
<a name="method_after">after</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Boolean
|
|
<strong property="yui:name">after</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
compareTo
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Determines whether a given date is after another date on the calendar.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The Date object to compare with the compare argument</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">compareTo</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The Date object to use for the comparison</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Boolean
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">true if the date occurs after the compared date; false if not.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_before">
|
|
<h4>
|
|
<a name="method_before">before</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Boolean
|
|
<strong property="yui:name">before</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
compareTo
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Determines whether a given date is before another date on the calendar.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The Date object to compare with the compare argument</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">compareTo</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The Date object to use for the comparison</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Boolean
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">true if the date occurs before the compared date; false if not.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_between">
|
|
<h4>
|
|
<a name="method_between">between</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Boolean
|
|
<strong property="yui:name">between</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
dateBegin
|
|
|
|
|
|
,
|
|
dateEnd
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Determines whether a given date is between two other dates on the calendar.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The date to check for</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">dateBegin</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The start of the range</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">dateEnd</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The end of the range</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Boolean
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">true if the date occurs between the compared dates; false if not.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_clearTime">
|
|
<h4>
|
|
<a name="method_clearTime">clearTime</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">clearTime</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Clears the time fields from a given date, effectively setting the time to 12 noon.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date for which the time fields will be cleared</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The JavaScript Date cleared of all time fields</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_findMonthEnd">
|
|
<h4>
|
|
<a name="method_findMonthEnd">findMonthEnd</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">findMonthEnd</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Gets the last day of a month containing a given date.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date used to calculate the month end</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The JavaScript Date representing the last day of the month</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_findMonthStart">
|
|
<h4>
|
|
<a name="method_findMonthStart">findMonthStart</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">findMonthStart</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Gets the first day of a month containing a given date.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date used to calculate the month start</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The JavaScript Date representing the first day of the month</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_getDate">
|
|
<h4>
|
|
<a name="method_getDate">getDate</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">getDate</strong>
|
|
(
|
|
|
|
|
|
y
|
|
|
|
|
|
,
|
|
m
|
|
|
|
|
|
,
|
|
d
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
|
|
are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations
|
|
set the year to 19xx if a year (xx) which is less than 100 is provided.
|
|
<p>
|
|
<em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
|
|
arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">y</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> Year.</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">m</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> Month index from 0 (Jan) to 11 (Dec).</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">d</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> (optional) Date from 1 to 31. If not provided, defaults to 1.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The JavaScript date object with year, month, date set as provided.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_getDayOffset">
|
|
<h4>
|
|
<a name="method_getDayOffset">getDayOffset</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Number
|
|
<strong property="yui:name">getDayOffset</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
calendarYear
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Calculates the number of days the specified date is from January 1 of the specified calendar year.
|
|
Passing January 1 to this function would return an offset value of zero.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript date for which to find the offset</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">calendarYear</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The calendar year to use for determining the offset</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Number
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The number of days since January 1 of the given year</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_getFirstDayOfWeek">
|
|
<h4>
|
|
<a name="method_getFirstDayOfWeek">getFirstDayOfWeek</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">getFirstDayOfWeek</strong>
|
|
(
|
|
|
|
|
|
dt
|
|
|
|
|
|
,
|
|
startOfWeek
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Get the first day of the week, for the give date.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">dt</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The date in the week for which the first day is required.</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">startOfWeek</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The index for the first day of the week, 0 = Sun, 1 = Mon ... 6 = Sat (defaults to 0)</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The first day of the week</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_getJan1">
|
|
<h4>
|
|
<a name="method_getJan1">getJan1</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">getJan1</strong>
|
|
(
|
|
|
|
|
|
calendarYear
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Retrieves a JavaScript Date object representing January 1 of any given year.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">calendarYear</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The calendar year for which to retrieve January 1</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">January 1 of the calendar year specified.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_getWeekNumber">
|
|
<h4>
|
|
<a name="method_getWeekNumber">getWeekNumber</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Number
|
|
<strong property="yui:name">getWeekNumber</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
firstDayOfWeek
|
|
|
|
|
|
,
|
|
janDate
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Calculates the week number for the given date. Can currently support standard
|
|
U.S. week numbers, based on Jan 1st defining the 1st week of the year, and
|
|
ISO8601 week numbers, based on Jan 4th defining the 1st week of the year.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript date for which to find the week number</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">firstDayOfWeek</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The index of the first day of the week (0 = Sun, 1 = Mon ... 6 = Sat).
|
|
Defaults to 0</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">janDate</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The date in the first week of January which defines week one for the year
|
|
Defaults to the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE, which is 1 (Jan 1st).
|
|
For the U.S, this is normally Jan 1st. ISO8601 uses Jan 4th to define the first week of the year.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Number
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The number of the week containing the given date.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_isMonthOverlapWeek">
|
|
<h4>
|
|
<a name="method_isMonthOverlapWeek">isMonthOverlapWeek</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Boolean
|
|
<strong property="yui:name">isMonthOverlapWeek</strong>
|
|
(
|
|
|
|
|
|
weekBeginDate
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Determines if a given week overlaps two different months.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">weekBeginDate</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date representing the first day of the week.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Boolean
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">true if the date overlaps two different months.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_isYearOverlapWeek">
|
|
<h4>
|
|
<a name="method_isYearOverlapWeek">isYearOverlapWeek</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Boolean
|
|
<strong property="yui:name">isYearOverlapWeek</strong>
|
|
(
|
|
|
|
|
|
weekBeginDate
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Determines if a given week overlaps two different years.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">weekBeginDate</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date representing the first day of the week.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Boolean
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">true if the date overlaps two different years.</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="" rel="yui:method" resource="#method_subtract">
|
|
<h4>
|
|
<a name="method_subtract">subtract</a></h4>
|
|
<div class="detail" >
|
|
<code>
|
|
|
|
|
|
|
|
Date
|
|
<strong property="yui:name">subtract</strong>
|
|
(
|
|
|
|
|
|
date
|
|
|
|
|
|
,
|
|
field
|
|
|
|
|
|
,
|
|
amount
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description" property="yui:description">
|
|
Subtracts the specified amount of time from the this instance.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl rel="yui:parameters">
|
|
<dt>Parameters:</dt>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">date</span>
|
|
<<span property="yui:type">Date</span>>
|
|
</code>
|
|
<span property="yui:description"> The JavaScript Date object to perform subtraction on</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">field</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The this field constant to be used for performing subtraction.</span>
|
|
</dd>
|
|
<dd rel="yui:parameter">
|
|
<code><span property="yui:name">amount</span>
|
|
<<span property="yui:type">Number</span>>
|
|
</code>
|
|
<span property="yui:description"> The number of units (measured in the field constant) to subtract from the date.</span>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code property="yui:return">
|
|
Date
|
|
</code></dt>
|
|
<dd property="yui:returnInfo">The resulting Date object</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div rel="yui:events" resource="#events">
|
|
|
|
|
|
</div>
|
|
|
|
<div rel="yui:attributes" resource="#configattributes">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
<div class="nav">
|
|
|
|
<div id="moduleList" class="module">
|
|
<h4>Modules</h4>
|
|
<ul class="content">
|
|
<li class=""><a href="module_animation.html" title="animation">animation</a></li>
|
|
<li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
|
|
<li class=""><a href="module_button.html" title="button">button</a></li>
|
|
<li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
|
|
<li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
|
|
<li class=""><a href="module_charts.html" title="charts">charts</a></li>
|
|
<li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
|
|
<li class=""><a href="module_connection.html" title="connection">connection</a></li>
|
|
<li class=""><a href="module_container.html" title="container">container</a></li>
|
|
<li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
|
|
<li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
|
|
<li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
|
|
<li class="selected"><a href="module_datemath.html" title="datemath">datemath</a></li>
|
|
<li class=""><a href="module_dom.html" title="dom">dom</a></li>
|
|
<li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
|
|
<li class=""><a href="module_editor.html" title="editor">editor</a></li>
|
|
<li class=""><a href="module_element.html" title="element">element</a></li>
|
|
<li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
|
|
<li class=""><a href="module_event.html" title="event">event</a></li>
|
|
<li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
|
|
<li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
|
|
<li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
|
|
<li class=""><a href="module_get.html" title="get">get</a></li>
|
|
<li class=""><a href="module_history.html" title="history">history</a></li>
|
|
<li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
|
|
<li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
|
|
<li class=""><a href="module_json.html" title="json">json</a></li>
|
|
<li class=""><a href="module_layout.html" title="layout">layout</a></li>
|
|
<li class=""><a href="module_logger.html" title="logger">logger</a></li>
|
|
<li class=""><a href="module_menu.html" title="menu">menu</a></li>
|
|
<li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
|
|
<li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
|
|
<li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
|
|
<li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
|
|
<li class=""><a href="module_resize.html" title="resize">resize</a></li>
|
|
<li class=""><a href="module_selector.html" title="selector">selector</a></li>
|
|
<li class=""><a href="module_slider.html" title="slider">slider</a></li>
|
|
<li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
|
|
<li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
|
|
<li class=""><a href="module_swf.html" title="swf">swf</a></li>
|
|
<li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
|
|
<li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
|
|
<li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
|
|
<li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
|
|
<li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
|
|
<li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
|
|
<li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
|
|
<li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="classList" class="module">
|
|
<h4>Classes</h4>
|
|
<ul class="content">
|
|
<li class="selected"><a href="YAHOO.widget.DateMath.html" title="YAHOO.widget.DateMath">YAHOO.widget.DateMath</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="fileList" class="module">
|
|
<h4>Files</h4>
|
|
<ul class="content">
|
|
<li class=""><a href="DateMath.js.html" title="DateMath.js">DateMath.js</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="propertyList" class="module">
|
|
<h4>Properties</h4>
|
|
<ul class="content">
|
|
<li class=""><a href="#property_DAY" title="DAY">DAY</a></li>
|
|
<li class=""><a href="#property_MONTH" title="MONTH">MONTH</a></li>
|
|
<li class=""><a href="#property_ONE_DAY_MS" title="ONE_DAY_MS">ONE_DAY_MS</a></li>
|
|
<li class=""><a href="#property_WEEK" title="WEEK">WEEK</a></li>
|
|
<li class=""><a href="#property_WEEK_ONE_JAN_DATE" title="WEEK_ONE_JAN_DATE">WEEK_ONE_JAN_DATE</a></li>
|
|
<li class=""><a href="#property_YEAR" title="YEAR">YEAR</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="methodsList" class="module">
|
|
<h4>Methods</h4>
|
|
<ul class="content">
|
|
<li class="private"><a href="#method__addDays" title="_addDays">_addDays</a></li>
|
|
<li class=""><a href="#method_add" title="add">add</a></li>
|
|
<li class=""><a href="#method_after" title="after">after</a></li>
|
|
<li class=""><a href="#method_before" title="before">before</a></li>
|
|
<li class=""><a href="#method_between" title="between">between</a></li>
|
|
<li class=""><a href="#method_clearTime" title="clearTime">clearTime</a></li>
|
|
<li class=""><a href="#method_findMonthEnd" title="findMonthEnd">findMonthEnd</a></li>
|
|
<li class=""><a href="#method_findMonthStart" title="findMonthStart">findMonthStart</a></li>
|
|
<li class=""><a href="#method_getDate" title="getDate">getDate</a></li>
|
|
<li class=""><a href="#method_getDayOffset" title="getDayOffset">getDayOffset</a></li>
|
|
<li class=""><a href="#method_getFirstDayOfWeek" title="getFirstDayOfWeek">getFirstDayOfWeek</a></li>
|
|
<li class=""><a href="#method_getJan1" title="getJan1">getJan1</a></li>
|
|
<li class=""><a href="#method_getWeekNumber" title="getWeekNumber">getWeekNumber</a></li>
|
|
<li class=""><a href="#method_isMonthOverlapWeek" title="isMonthOverlapWeek">isMonthOverlapWeek</a></li>
|
|
<li class=""><a href="#method_isYearOverlapWeek" title="isYearOverlapWeek">isYearOverlapWeek</a></li>
|
|
<li class=""><a href="#method_subtract" title="subtract">subtract</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="ft">
|
|
<hr />
|
|
Copyright © 2010 Yahoo! Inc. All rights reserved.
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
|
|
var ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.DateMath", "name": "add", "url": "YAHOO.widget.DateMath.html#method_add", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DateMath", "name": "_addDays", "url": "YAHOO.widget.DateMath.html#method__addDays", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "after", "url": "YAHOO.widget.DateMath.html#method_after", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "before", "url": "YAHOO.widget.DateMath.html#method_before", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "between", "url": "YAHOO.widget.DateMath.html#method_between", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "clearTime", "url": "YAHOO.widget.DateMath.html#method_clearTime", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "DAY", "url": "YAHOO.widget.DateMath.html#property_DAY", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "findMonthEnd", "url": "YAHOO.widget.DateMath.html#method_findMonthEnd", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "findMonthStart", "url": "YAHOO.widget.DateMath.html#method_findMonthStart", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "getDate", "url": "YAHOO.widget.DateMath.html#method_getDate", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "getDayOffset", "url": "YAHOO.widget.DateMath.html#method_getDayOffset", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "getFirstDayOfWeek", "url": "YAHOO.widget.DateMath.html#method_getFirstDayOfWeek", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "getJan1", "url": "YAHOO.widget.DateMath.html#method_getJan1", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "getWeekNumber", "url": "YAHOO.widget.DateMath.html#method_getWeekNumber", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "isMonthOverlapWeek", "url": "YAHOO.widget.DateMath.html#method_isMonthOverlapWeek", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "isYearOverlapWeek", "url": "YAHOO.widget.DateMath.html#method_isYearOverlapWeek", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "MONTH", "url": "YAHOO.widget.DateMath.html#property_MONTH", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "ONE_DAY_MS", "url": "YAHOO.widget.DateMath.html#property_ONE_DAY_MS", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "subtract", "url": "YAHOO.widget.DateMath.html#method_subtract", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "WEEK", "url": "YAHOO.widget.DateMath.html#property_WEEK", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "WEEK_ONE_JAN_DATE", "url": "YAHOO.widget.DateMath.html#property_WEEK_ONE_JAN_DATE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateMath", "name": "YEAR", "url": "YAHOO.widget.DateMath.html#property_YEAR", "type": "property"}];
|
|
</script>
|
|
</body>
|
|
</html>
|