links.Timeline.StepDate.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="JsDoc Toolkit" />
  7. <title>JsDoc Reference - links.Timeline.StepDate</title>
  8. <style type="text/css">
  9. /* default.css */
  10. body
  11. {
  12. font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
  13. width: 800px;
  14. }
  15. .header
  16. {
  17. clear: both;
  18. background-color: #ccc;
  19. padding: 8px;
  20. }
  21. h1
  22. {
  23. font-size: 150%;
  24. font-weight: bold;
  25. padding: 0;
  26. margin: 1em 0 0 .3em;
  27. }
  28. hr
  29. {
  30. border: none 0;
  31. border-top: 1px solid #7F8FB1;
  32. height: 1px;
  33. }
  34. pre.code
  35. {
  36. display: block;
  37. padding: 8px;
  38. border: 1px dashed #ccc;
  39. }
  40. #index
  41. {
  42. margin-top: 24px;
  43. float: left;
  44. width: 160px;
  45. position: absolute;
  46. left: 8px;
  47. background-color: #F3F3F3;
  48. padding: 8px;
  49. }
  50. #content
  51. {
  52. margin-left: 190px;
  53. width: 600px;
  54. }
  55. .classList
  56. {
  57. list-style-type: none;
  58. padding: 0;
  59. margin: 0 0 0 8px;
  60. font-family: arial, sans-serif;
  61. font-size: 1em;
  62. overflow: auto;
  63. }
  64. .classList li
  65. {
  66. padding: 0;
  67. margin: 0 0 8px 0;
  68. }
  69. .summaryTable { width: 100%; }
  70. h1.classTitle
  71. {
  72. font-size:170%;
  73. line-height:130%;
  74. }
  75. h2 { font-size: 110%; }
  76. caption, div.sectionTitle
  77. {
  78. background-color: #7F8FB1;
  79. color: #fff;
  80. font-size:130%;
  81. text-align: left;
  82. padding: 2px 6px 2px 6px;
  83. border: 1px #7F8FB1 solid;
  84. }
  85. div.sectionTitle { margin-bottom: 8px; }
  86. .summaryTable thead { display: none; }
  87. .summaryTable td
  88. {
  89. vertical-align: top;
  90. padding: 4px;
  91. border-bottom: 1px #7F8FB1 solid;
  92. border-right: 1px #7F8FB1 solid;
  93. }
  94. /*col#summaryAttributes {}*/
  95. .summaryTable td.attributes
  96. {
  97. border-left: 1px #7F8FB1 solid;
  98. width: 140px;
  99. text-align: right;
  100. }
  101. td.attributes, .fixedFont
  102. {
  103. line-height: 15px;
  104. color: #002EBE;
  105. font-family: "Courier New",Courier,monospace;
  106. font-size: 13px;
  107. }
  108. .summaryTable td.nameDescription
  109. {
  110. text-align: left;
  111. font-size: 13px;
  112. line-height: 15px;
  113. }
  114. .summaryTable td.nameDescription, .description
  115. {
  116. line-height: 15px;
  117. padding: 4px;
  118. padding-left: 4px;
  119. }
  120. .summaryTable { margin-bottom: 8px; }
  121. ul.inheritsList
  122. {
  123. list-style: square;
  124. margin-left: 20px;
  125. padding-left: 0;
  126. }
  127. .detailList {
  128. margin-left: 20px;
  129. line-height: 15px;
  130. }
  131. .detailList dt { margin-left: 20px; }
  132. .detailList .heading
  133. {
  134. font-weight: bold;
  135. padding-bottom: 6px;
  136. margin-left: 0;
  137. }
  138. .light, td.attributes, .light a:link, .light a:visited
  139. {
  140. color: #777;
  141. font-style: italic;
  142. }
  143. .fineprint
  144. {
  145. text-align: right;
  146. font-size: 10px;
  147. }
  148. </style>
  149. </head>
  150. <body>
  151. <!-- ============================== header ================================= -->
  152. <!-- begin static/header.html -->
  153. <div id="header">
  154. </div>
  155. <!-- end static/header.html -->
  156. <!-- ============================== classes index ============================ -->
  157. <div id="index">
  158. <!-- begin publish.classesIndex -->
  159. <div align="center"><a href="../index.html">Class Index</a>
  160. | <a href="../files.html">File Index</a></div>
  161. <hr />
  162. <h2>Classes</h2>
  163. <ul class="classList">
  164. <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
  165. <li><a href="../symbols/Array.html">Array</a></li>
  166. <li><a href="../symbols/links.Timeline.html">links.Timeline</a></li>
  167. <li><a href="../symbols/links.Timeline.StepDate.html">links.Timeline.StepDate</a></li>
  168. </ul>
  169. <hr />
  170. <!-- end publish.classesIndex -->
  171. </div>
  172. <div id="content">
  173. <!-- ============================== class title ============================ -->
  174. <h1 class="classTitle">
  175. Class links.Timeline.StepDate
  176. </h1>
  177. <!-- ============================== class summary ========================== -->
  178. <p class="description">
  179. <br /><i>Defined in: </i> <a href="../symbols/src/timeline.js.html">timeline.js</a>.
  180. </p>
  181. <!-- ============================== constructor summary ==================== -->
  182. <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class links.Timeline.StepDate.">
  183. <caption>Class Summary</caption>
  184. <thead>
  185. <tr>
  186. <th scope="col">Constructor Attributes</th>
  187. <th scope="col">Constructor Name and Description</th>
  188. </tr>
  189. </thead>
  190. <tbody>
  191. <tr>
  192. <td class="attributes">&nbsp;</td>
  193. <td class="nameDescription" >
  194. <div class="fixedFont">
  195. <b><a href="../symbols/links.Timeline.StepDate.html#constructor">links.Timeline.StepDate</a></b>(start, end, minimumStep)
  196. </div>
  197. <div class="description"></div>
  198. </td>
  199. </tr>
  200. </tbody>
  201. </table>
  202. <!-- ============================== properties summary ===================== -->
  203. <!-- ============================== methods summary ======================== -->
  204. <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class links.Timeline.StepDate.">
  205. <caption>Method Summary</caption>
  206. <thead>
  207. <tr>
  208. <th scope="col">Method Attributes</th>
  209. <th scope="col">Method Name and Description</th>
  210. </tr>
  211. </thead>
  212. <tbody>
  213. <tr>
  214. <td class="attributes">&nbsp;</td>
  215. <td class="nameDescription">
  216. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#addZeros">addZeros</a></b>(value, len)
  217. </div>
  218. <div class="description">Add leading zeros to the given value to match the desired length.</div>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td class="attributes">&nbsp;</td>
  223. <td class="nameDescription">
  224. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#end">end</a></b>()
  225. </div>
  226. <div class="description">Check if the end date is reached</div>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td class="attributes">&nbsp;</td>
  231. <td class="nameDescription">
  232. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#getCurrent">getCurrent</a></b>()
  233. </div>
  234. <div class="description">Get the current datetime</div>
  235. </td>
  236. </tr>
  237. <tr>
  238. <td class="attributes">&nbsp;</td>
  239. <td class="nameDescription">
  240. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#getLabelMajor">getLabelMajor</a></b>(date)
  241. </div>
  242. <div class="description">Returns formatted text for the major axislabel, depending on the current
  243. date and the scale.</div>
  244. </td>
  245. </tr>
  246. <tr>
  247. <td class="attributes">&nbsp;</td>
  248. <td class="nameDescription">
  249. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#getLabelMinor">getLabelMinor</a></b>(date)
  250. </div>
  251. <div class="description">Returns formatted text for the minor axislabel, depending on the current
  252. date and the scale.</div>
  253. </td>
  254. </tr>
  255. <tr>
  256. <td class="attributes">&nbsp;</td>
  257. <td class="nameDescription">
  258. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#isMajor">isMajor</a></b>()
  259. </div>
  260. <div class="description">Check if the current step is a major step (for example when the step
  261. is DAY, a major step is each first day of the MONTH)</div>
  262. </td>
  263. </tr>
  264. <tr>
  265. <td class="attributes">&nbsp;</td>
  266. <td class="nameDescription">
  267. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#next">next</a></b>()
  268. </div>
  269. <div class="description">Do the next step</div>
  270. </td>
  271. </tr>
  272. <tr>
  273. <td class="attributes">&nbsp;</td>
  274. <td class="nameDescription">
  275. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#roundToMinor">roundToMinor</a></b>()
  276. </div>
  277. <div class="description">Round the current date to the first minor date value
  278. This must be executed once when the current date is set to start Date</div>
  279. </td>
  280. </tr>
  281. <tr>
  282. <td class="attributes">&nbsp;</td>
  283. <td class="nameDescription">
  284. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#setAutoScale">setAutoScale</a></b>(enable)
  285. </div>
  286. <div class="description">Enable or disable autoscaling</div>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td class="attributes">&nbsp;</td>
  291. <td class="nameDescription">
  292. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#setMinimumStep">setMinimumStep</a></b>(minimumStep)
  293. </div>
  294. <div class="description">Automatically determine the scale that bests fits the provided minimum step</div>
  295. </td>
  296. </tr>
  297. <tr>
  298. <td class="attributes">&nbsp;</td>
  299. <td class="nameDescription">
  300. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#setRange">setRange</a></b>(start, end, minimumStep)
  301. </div>
  302. <div class="description">Set a new range
  303. If minimumStep is provided, the step size is chosen as close as possible
  304. to the minimumStep but larger than minimumStep.</div>
  305. </td>
  306. </tr>
  307. <tr>
  308. <td class="attributes">&nbsp;</td>
  309. <td class="nameDescription">
  310. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#setScale">setScale</a></b>(newScale, newStep)
  311. </div>
  312. <div class="description">Set a custom scale.</div>
  313. </td>
  314. </tr>
  315. <tr>
  316. <td class="attributes">&nbsp;</td>
  317. <td class="nameDescription">
  318. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#snap">snap</a></b>(date)
  319. </div>
  320. <div class="description">Snap a date to a rounded value.</div>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td class="attributes">&nbsp;</td>
  325. <td class="nameDescription">
  326. <div class="fixedFont"><b><a href="../symbols/links.Timeline.StepDate.html#start">start</a></b>()
  327. </div>
  328. <div class="description">Set the step iterator to the start date.</div>
  329. </td>
  330. </tr>
  331. </tbody>
  332. </table>
  333. <!-- ============================== events summary ======================== -->
  334. <!-- ============================== constructor details ==================== -->
  335. <div class="details"><a name="constructor"> </a>
  336. <div class="sectionTitle">
  337. Class Detail
  338. </div>
  339. <div class="fixedFont">
  340. <b>links.Timeline.StepDate</b>(start, end, minimumStep)
  341. </div>
  342. <div class="description">
  343. </div>
  344. <dl class="detailList">
  345. <dt class="heading">Parameters:</dt>
  346. <dt>
  347. <span class="light fixedFont">{Date}</span> <b>start</b>
  348. </dt>
  349. <dd>The start date, for example new Date(2010, 9, 21)
  350. or new Date(2010, 9,21,23,45,00)</dd>
  351. <dt>
  352. <span class="light fixedFont">{Date}</span> <b>end</b>
  353. </dt>
  354. <dd>The end date</dd>
  355. <dt>
  356. <span class="light fixedFont">{int}</span> <b>minimumStep</b>
  357. </dt>
  358. <dd>Optional. Minimum step size in milliseconds</dd>
  359. </dl>
  360. </div>
  361. <!-- ============================== field details ========================== -->
  362. <!-- ============================== method details ========================= -->
  363. <div class="sectionTitle">
  364. Method Detail
  365. </div>
  366. <a name="addZeros"> </a>
  367. <div class="fixedFont">
  368. <span class="light">{string}</span>
  369. <b>addZeros</b>(value, len)
  370. </div>
  371. <div class="description">
  372. Add leading zeros to the given value to match the desired length.
  373. For example addZeros(123, 5) returns "00123"
  374. </div>
  375. <dl class="detailList">
  376. <dt class="heading">Parameters:</dt>
  377. <dt>
  378. <span class="light fixedFont">{int}</span> <b>value</b>
  379. </dt>
  380. <dd>A value</dd>
  381. <dt>
  382. <span class="light fixedFont">{int}</span> <b>len</b>
  383. </dt>
  384. <dd>Desired final length</dd>
  385. </dl>
  386. <dl class="detailList">
  387. <dt class="heading">Returns:</dt>
  388. <dd><span class="light fixedFont">{string}</span> value with leading zeros</dd>
  389. </dl>
  390. <hr />
  391. <a name="end"> </a>
  392. <div class="fixedFont">
  393. <span class="light">{boolean}</span>
  394. <b>end</b>()
  395. </div>
  396. <div class="description">
  397. Check if the end date is reached
  398. </div>
  399. <dl class="detailList">
  400. <dt class="heading">Returns:</dt>
  401. <dd><span class="light fixedFont">{boolean}</span> true if the current date has passed the end date</dd>
  402. </dl>
  403. <hr />
  404. <a name="getCurrent"> </a>
  405. <div class="fixedFont">
  406. <span class="light">{Date}</span>
  407. <b>getCurrent</b>()
  408. </div>
  409. <div class="description">
  410. Get the current datetime
  411. </div>
  412. <dl class="detailList">
  413. <dt class="heading">Returns:</dt>
  414. <dd><span class="light fixedFont">{Date}</span> current The current date</dd>
  415. </dl>
  416. <hr />
  417. <a name="getLabelMajor"> </a>
  418. <div class="fixedFont">
  419. <span class="light">{string}</span>
  420. <b>getLabelMajor</b>(date)
  421. </div>
  422. <div class="description">
  423. Returns formatted text for the major axislabel, depending on the current
  424. date and the scale. For example when scale is MINUTE, the major scale is
  425. hours, and the hour will be formatted as "hh".
  426. </div>
  427. <dl class="detailList">
  428. <dt class="heading">Parameters:</dt>
  429. <dt>
  430. <span class="light fixedFont">{Date}</span> <b>date</b>
  431. <i>Optional</i>
  432. </dt>
  433. <dd>custom date. if not provided, current date is taken</dd>
  434. </dl>
  435. <dl class="detailList">
  436. <dt class="heading">Returns:</dt>
  437. <dd><span class="light fixedFont">{string}</span> major axislabel</dd>
  438. </dl>
  439. <hr />
  440. <a name="getLabelMinor"> </a>
  441. <div class="fixedFont">
  442. <span class="light">{string}</span>
  443. <b>getLabelMinor</b>(date)
  444. </div>
  445. <div class="description">
  446. Returns formatted text for the minor axislabel, depending on the current
  447. date and the scale. For example when scale is MINUTE, the current time is
  448. formatted as "hh:mm".
  449. </div>
  450. <dl class="detailList">
  451. <dt class="heading">Parameters:</dt>
  452. <dt>
  453. <span class="light fixedFont">{Date}</span> <b>date</b>
  454. <i>Optional</i>
  455. </dt>
  456. <dd>custom date. if not provided, current date is taken</dd>
  457. </dl>
  458. <dl class="detailList">
  459. <dt class="heading">Returns:</dt>
  460. <dd><span class="light fixedFont">{string}</span> minor axislabel</dd>
  461. </dl>
  462. <hr />
  463. <a name="isMajor"> </a>
  464. <div class="fixedFont">
  465. <b>isMajor</b>()
  466. </div>
  467. <div class="description">
  468. Check if the current step is a major step (for example when the step
  469. is DAY, a major step is each first day of the MONTH)
  470. </div>
  471. <dl class="detailList">
  472. <dt class="heading">Returns:</dt>
  473. <dd>true if current date is major, else false.</dd>
  474. </dl>
  475. <hr />
  476. <a name="next"> </a>
  477. <div class="fixedFont">
  478. <b>next</b>()
  479. </div>
  480. <div class="description">
  481. Do the next step
  482. </div>
  483. <hr />
  484. <a name="roundToMinor"> </a>
  485. <div class="fixedFont">
  486. <b>roundToMinor</b>()
  487. </div>
  488. <div class="description">
  489. Round the current date to the first minor date value
  490. This must be executed once when the current date is set to start Date
  491. </div>
  492. <hr />
  493. <a name="setAutoScale"> </a>
  494. <div class="fixedFont">
  495. <b>setAutoScale</b>(enable)
  496. </div>
  497. <div class="description">
  498. Enable or disable autoscaling
  499. </div>
  500. <dl class="detailList">
  501. <dt class="heading">Parameters:</dt>
  502. <dt>
  503. <span class="light fixedFont">{boolean}</span> <b>enable</b>
  504. </dt>
  505. <dd>If true, autoascaling is set true</dd>
  506. </dl>
  507. <hr />
  508. <a name="setMinimumStep"> </a>
  509. <div class="fixedFont">
  510. <b>setMinimumStep</b>(minimumStep)
  511. </div>
  512. <div class="description">
  513. Automatically determine the scale that bests fits the provided minimum step
  514. </div>
  515. <dl class="detailList">
  516. <dt class="heading">Parameters:</dt>
  517. <dt>
  518. <span class="light fixedFont">{int}</span> <b>minimumStep</b>
  519. </dt>
  520. <dd>The minimum step size in milliseconds</dd>
  521. </dl>
  522. <hr />
  523. <a name="setRange"> </a>
  524. <div class="fixedFont">
  525. <b>setRange</b>(start, end, minimumStep)
  526. </div>
  527. <div class="description">
  528. Set a new range
  529. If minimumStep is provided, the step size is chosen as close as possible
  530. to the minimumStep but larger than minimumStep. If minimumStep is not
  531. provided, the scale is set to 1 DAY.
  532. The minimumStep should correspond with the onscreen size of about 6 characters
  533. </div>
  534. <dl class="detailList">
  535. <dt class="heading">Parameters:</dt>
  536. <dt>
  537. <span class="light fixedFont">{Date}</span> <b>start</b>
  538. </dt>
  539. <dd>The start date and time.</dd>
  540. <dt>
  541. <span class="light fixedFont">{Date}</span> <b>end</b>
  542. </dt>
  543. <dd>The end date and time.</dd>
  544. <dt>
  545. <span class="light fixedFont">{int}</span> <b>minimumStep</b>
  546. </dt>
  547. <dd>Optional. Minimum step size in milliseconds</dd>
  548. </dl>
  549. <hr />
  550. <a name="setScale"> </a>
  551. <div class="fixedFont">
  552. <b>setScale</b>(newScale, newStep)
  553. </div>
  554. <div class="description">
  555. Set a custom scale. Autoscaling will be disabled.
  556. For example setScale(SCALE.MINUTES, 5) will result
  557. in minor steps of 5 minutes, and major steps of an hour.
  558. </div>
  559. <dl class="detailList">
  560. <dt class="heading">Parameters:</dt>
  561. <dt>
  562. <span class="light fixedFont">{links.Timeline.StepDate.SCALE}</span> <b>newScale</b>
  563. </dt>
  564. <dd>A scale. Choose from SCALE.MILLISECOND,
  565. SCALE.SECOND, SCALE.MINUTE, SCALE.HOUR,
  566. SCALE.DAY, SCALE.MONTH, SCALE.YEAR.</dd>
  567. <dt>
  568. <span class="light fixedFont">{int}</span> <b>newStep</b>
  569. </dt>
  570. <dd>A step size, by default 1. Choose for
  571. example 1, 2, 5, or 10.</dd>
  572. </dl>
  573. <hr />
  574. <a name="snap"> </a>
  575. <div class="fixedFont">
  576. <b>snap</b>(date)
  577. </div>
  578. <div class="description">
  579. Snap a date to a rounded value. The snap intervals are dependent on the
  580. current scale and step.
  581. </div>
  582. <dl class="detailList">
  583. <dt class="heading">Parameters:</dt>
  584. <dt>
  585. <span class="light fixedFont">{Date}</span> <b>date</b>
  586. </dt>
  587. <dd>the date to be snapped</dd>
  588. </dl>
  589. <hr />
  590. <a name="start"> </a>
  591. <div class="fixedFont">
  592. <b>start</b>()
  593. </div>
  594. <div class="description">
  595. Set the step iterator to the start date.
  596. </div>
  597. <!-- ============================== event details ========================= -->
  598. <hr />
  599. </div>
  600. <!-- ============================== footer ================================= -->
  601. <div class="fineprint" style="clear:both">
  602. Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Mon Jun 18 2012 09:12:45 GMT+0200 (CEST)
  603. </div>
  604. </body>
  605. </html>