| 1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
<html lang="en"> |
| 4 |
<head> |
| 5 |
<meta charset="utf-8"> |
| 6 |
<meta name="viewport" content="width=device-width"> |
| 7 |
<title>weekstart Module: api</title> |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> |
| 13 |
|
| 14 |
<link type="text/css" rel="stylesheet" href="styles/site.spacelab.css"> |
| 15 |
|
| 16 |
</head> |
| 17 |
|
| 18 |
<body> |
| 19 |
|
| 20 |
<div class="navbar navbar-default navbar-fixed-top "> |
| 21 |
<div class="container"> |
| 22 |
<div class="navbar-header"> |
| 23 |
<a class="navbar-brand" href="index.html">weekstart</a> |
| 24 |
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> |
| 25 |
<span class="icon-bar"></span> |
| 26 |
<span class="icon-bar"></span> |
| 27 |
<span class="icon-bar"></span> |
| 28 |
</button> |
| 29 |
</div> |
| 30 |
<div class="navbar-collapse collapse" id="topNavigation"> |
| 31 |
<ul class="nav navbar-nav"> |
| 32 |
|
| 33 |
<li class="dropdown"> |
| 34 |
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> |
| 35 |
<ul class="dropdown-menu "> |
| 36 |
<li><a href="module-api.html">api</a></li><li><a href="module-full.html">full</a></li><li><a href="module-fullLangRegionMap.html">fullLangRegionMap</a></li><li><a href="module-langRegionMap.html">langRegionMap</a></li><li><a href="module-main.html">main</a></li><li><a href="module-regionDayMap.html">regionDayMap</a></li> |
| 37 |
</ul> |
| 38 |
</li> |
| 39 |
|
| 40 |
</ul> |
| 41 |
|
| 42 |
<div class="col-sm-3 col-md-3"> |
| 43 |
<form class="navbar-form" role="search"> |
| 44 |
<div class="input-group"> |
| 45 |
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> |
| 46 |
<div class="input-group-btn"> |
| 47 |
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
</form> |
| 51 |
</div> |
| 52 |
|
| 53 |
</div> |
| 54 |
|
| 55 |
</div> |
| 56 |
</div> |
| 57 |
|
| 58 |
|
| 59 |
<div class="container" id="toc-content"> |
| 60 |
<div class="row"> |
| 61 |
|
| 62 |
|
| 63 |
<div class="col-md-8"> |
| 64 |
|
| 65 |
<div id="main"> |
| 66 |
|
| 67 |
|
| 68 |
<h1 class="page-title">Module: api</h1> |
| 69 |
<section> |
| 70 |
|
| 71 |
<header> |
| 72 |
|
| 73 |
</header> |
| 74 |
|
| 75 |
|
| 76 |
<article> |
| 77 |
<div class="container-overview"> |
| 78 |
|
| 79 |
|
| 80 |
<div class="description"><p>Functions to get first day of week.</p></div> |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
<dl class="details"> |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> |
| 115 |
<dd class="tag-source"> |
| 116 |
<ul class="dummy"> |
| 117 |
<li> |
| 118 |
<a href="api.js.html">api.js</a>, |
| 119 |
<a href="api.js.html#sunlight-1-line-1">line 1</a> |
| 120 |
</li> |
| 121 |
</ul> |
| 122 |
</dd> |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
</dl> |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
</div> |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
<h3 class="subsection-title">Methods</h3> |
| 151 |
|
| 152 |
<dl> |
| 153 |
|
| 154 |
<hr> |
| 155 |
<dt> |
| 156 |
<h4 class="name" id=".getWeekStartByLocale"><span class="type-signature"><static> </span>getWeekStartByLocale(locale, langRegionMap, regionDayMap)</h4> |
| 157 |
|
| 158 |
|
| 159 |
</dt> |
| 160 |
<dd> |
| 161 |
|
| 162 |
|
| 163 |
<div class="description"> |
| 164 |
<p>Return first day of week for locale identifier.</p> |
| 165 |
</div> |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
<h5>Parameters:</h5> |
| 175 |
|
| 176 |
|
| 177 |
<table class="params table table-striped"> |
| 178 |
<thead> |
| 179 |
<tr> |
| 180 |
|
| 181 |
<th>Name</th> |
| 182 |
|
| 183 |
|
| 184 |
<th>Type</th> |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
<th class="last">Description</th> |
| 191 |
</tr> |
| 192 |
</thead> |
| 193 |
|
| 194 |
<tbody> |
| 195 |
|
| 196 |
|
| 197 |
<tr> |
| 198 |
|
| 199 |
<td class="name"><code>locale</code></td> |
| 200 |
|
| 201 |
|
| 202 |
<td class="type"> |
| 203 |
|
| 204 |
|
| 205 |
<span class="param-type">string</span> |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
</td> |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
<td class="description last"><p>Locale identifier.</p></td> |
| 217 |
</tr> |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
<tr> |
| 222 |
|
| 223 |
<td class="name"><code>langRegionMap</code></td> |
| 224 |
|
| 225 |
|
| 226 |
<td class="type"> |
| 227 |
|
| 228 |
|
| 229 |
<span class="param-type">object</span> |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
</td> |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
<td class="description last"><p>Mapping of language code to country/region code that should be used to get result. |
| 241 |
Language codes should be in lower case.</p></td> |
| 242 |
</tr> |
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
<tr> |
| 247 |
|
| 248 |
<td class="name"><code>regionDayMap</code></td> |
| 249 |
|
| 250 |
|
| 251 |
<td class="type"> |
| 252 |
|
| 253 |
|
| 254 |
<span class="param-type">object</span> |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
</td> |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
<td class="description last"><p>Mapping of country/region code to first day of week that should be used to get result. |
| 266 |
Country codes should be in upper case.</p></td> |
| 267 |
</tr> |
| 268 |
|
| 269 |
|
| 270 |
</tbody> |
| 271 |
</table> |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<dl class="details"> |
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> |
| 307 |
<dd class="tag-source"> |
| 308 |
<ul class="dummy"> |
| 309 |
<li> |
| 310 |
<a href="api.js.html">api.js</a>, |
| 311 |
<a href="api.js.html#sunlight-1-line-61">line 61</a> |
| 312 |
</li> |
| 313 |
</ul> |
| 314 |
</dd> |
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
</dl> |
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
<h5>Returns:</h5> |
| 337 |
|
| 338 |
|
| 339 |
<div class="param-desc"> |
| 340 |
<p>Code of first day of week for the given locale identifier: |
| 341 |
0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.</p> |
| 342 |
</div> |
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
<dl> |
| 347 |
<dt> |
| 348 |
Type |
| 349 |
</dt> |
| 350 |
<dd> |
| 351 |
|
| 352 |
<span class="param-type">number</span> |
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
</dd> |
| 357 |
</dl> |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
<h5>Example</h5> |
| 364 |
|
| 365 |
<pre class="sunlight-highlight-javascript">getWeekStartByLocale('no', {}, {}); // 1 |
| 366 |
getWeekStartByLocale('no', {no: 'abc'}, {ABC: 3}); // 3 |
| 367 |
getWeekStartByLocale('KK_arab', {kk_arab: 'CN'}, {CN: 0}); // 0 |
| 368 |
getWeekStartByLocale('fr-DZ', {fr: 'FR'}, {FR: 1, DZ: 6}); // 6</pre> |
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
</dd> |
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
<hr> |
| 377 |
<dt> |
| 378 |
<h4 class="name" id=".getWeekStartByRegion"><span class="type-signature"><static> </span>getWeekStartByRegion(regionCode, regionDayMap)</h4> |
| 379 |
|
| 380 |
|
| 381 |
</dt> |
| 382 |
<dd> |
| 383 |
|
| 384 |
|
| 385 |
<div class="description"> |
| 386 |
<p>Return first day of week for country/region code.</p> |
| 387 |
</div> |
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
<h5>Parameters:</h5> |
| 397 |
|
| 398 |
|
| 399 |
<table class="params table table-striped"> |
| 400 |
<thead> |
| 401 |
<tr> |
| 402 |
|
| 403 |
<th>Name</th> |
| 404 |
|
| 405 |
|
| 406 |
<th>Type</th> |
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
<th class="last">Description</th> |
| 413 |
</tr> |
| 414 |
</thead> |
| 415 |
|
| 416 |
<tbody> |
| 417 |
|
| 418 |
|
| 419 |
<tr> |
| 420 |
|
| 421 |
<td class="name"><code>regionCode</code></td> |
| 422 |
|
| 423 |
|
| 424 |
<td class="type"> |
| 425 |
|
| 426 |
|
| 427 |
<span class="param-type">number</span> |
| 428 |
| |
| 429 |
|
| 430 |
<span class="param-type">string</span> |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
</td> |
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
<td class="description last"><p>ISO 3166 Alpha-2, Alpha-3 or numeric code.</p></td> |
| 442 |
</tr> |
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
<tr> |
| 447 |
|
| 448 |
<td class="name"><code>regionDayMap</code></td> |
| 449 |
|
| 450 |
|
| 451 |
<td class="type"> |
| 452 |
|
| 453 |
|
| 454 |
<span class="param-type">object</span> |
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
</td> |
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
<td class="description last"><p>Mapping of country/region code to first day of week that should be used to get result. |
| 466 |
Country codes should be in upper case.</p></td> |
| 467 |
</tr> |
| 468 |
|
| 469 |
|
| 470 |
</tbody> |
| 471 |
</table> |
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
<dl class="details"> |
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> |
| 507 |
<dd class="tag-source"> |
| 508 |
<ul class="dummy"> |
| 509 |
<li> |
| 510 |
<a href="api.js.html">api.js</a>, |
| 511 |
<a href="api.js.html#sunlight-1-line-27">line 27</a> |
| 512 |
</li> |
| 513 |
</ul> |
| 514 |
</dd> |
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
</dl> |
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
<h5>Returns:</h5> |
| 537 |
|
| 538 |
|
| 539 |
<div class="param-desc"> |
| 540 |
<p>Code of first day of week for the given country/region code: |
| 541 |
0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.</p> |
| 542 |
</div> |
| 543 |
|
| 544 |
|
| 545 |
|
| 546 |
<dl> |
| 547 |
<dt> |
| 548 |
Type |
| 549 |
</dt> |
| 550 |
<dd> |
| 551 |
|
| 552 |
<span class="param-type">number</span> |
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
</dd> |
| 557 |
</dl> |
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
<h5>Example</h5> |
| 564 |
|
| 565 |
<pre class="sunlight-highlight-javascript">getWeekStartByRegion('PNG', {}); // 1 |
| 566 |
getWeekStartByRegion('png', {BR: 0, PNG: 3, EG: 6}); // 3 |
| 567 |
getWeekStartByRegion('qa', {QA: 6}); // 6 |
| 568 |
getWeekStartByRegion(50, {BD: 5, 50: 5, SD: 6}); // 5</pre> |
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
</dd> |
| 573 |
|
| 574 |
</dl> |
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
</article> |
| 581 |
|
| 582 |
</section> |
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
</div> |
| 588 |
</div> |
| 589 |
|
| 590 |
<div class="clearfix"></div> |
| 591 |
|
| 592 |
|
| 593 |
<div class="col-md-3"> |
| 594 |
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div> |
| 595 |
</div> |
| 596 |
|
| 597 |
|
| 598 |
</div> |
| 599 |
</div> |
| 600 |
|
| 601 |
|
| 602 |
<div class="modal fade" id="searchResults"> |
| 603 |
<div class="modal-dialog"> |
| 604 |
<div class="modal-content"> |
| 605 |
<div class="modal-header"> |
| 606 |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 607 |
<h4 class="modal-title">Search results</h4> |
| 608 |
</div> |
| 609 |
<div class="modal-body"></div> |
| 610 |
<div class="modal-footer"> |
| 611 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
| 612 |
</div> |
| 613 |
</div> |
| 614 |
</div> |
| 615 |
</div> |
| 616 |
|
| 617 |
|
| 618 |
<footer> |
| 619 |
|
| 620 |
|
| 621 |
<span class="copyright"> |
| 622 |
Copyright (c) 2017-present Denis Sikuler |
| 623 |
</span> |
| 624 |
|
| 625 |
<span class="jsdoc-message"> |
| 626 |
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> |
| 627 |
|
| 628 |
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. |
| 629 |
</span> |
| 630 |
</footer> |
| 631 |
|
| 632 |
<script src="scripts/docstrap.lib.js"></script> |
| 633 |
<script src="scripts/toc.js"></script> |
| 634 |
|
| 635 |
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> |
| 636 |
|
| 637 |
|
| 638 |
<script> |
| 639 |
$( function () { |
| 640 |
$( "[id*='$']" ).each( function () { |
| 641 |
var $this = $( this ); |
| 642 |
|
| 643 |
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); |
| 644 |
} ); |
| 645 |
|
| 646 |
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () { |
| 647 |
var $this = $( this ); |
| 648 |
|
| 649 |
var example = $this.find( "code" ); |
| 650 |
exampleText = example.html(); |
| 651 |
var lang = /{@lang (.*?)}/.exec( exampleText ); |
| 652 |
if ( lang && lang[1] ) { |
| 653 |
exampleText = exampleText.replace( lang[0], "" ); |
| 654 |
example.html( exampleText ); |
| 655 |
lang = lang[1]; |
| 656 |
} else { |
| 657 |
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); |
| 658 |
lang = langClassMatch ? langClassMatch[1] : "javascript"; |
| 659 |
} |
| 660 |
|
| 661 |
if ( lang ) { |
| 662 |
|
| 663 |
$this |
| 664 |
.addClass( "sunlight-highlight-" + lang ) |
| 665 |
.addClass( "linenums" ) |
| 666 |
.html( example.html() ); |
| 667 |
|
| 668 |
} |
| 669 |
} ); |
| 670 |
|
| 671 |
Sunlight.highlightAll( { |
| 672 |
lineNumbers : true, |
| 673 |
showMenu : true, |
| 674 |
enableDoclinks : true |
| 675 |
} ); |
| 676 |
|
| 677 |
$.catchAnchorLinks( { |
| 678 |
navbarOffset: 10 |
| 679 |
} ); |
| 680 |
$( "#toc" ).toc( { |
| 681 |
anchorName : function ( i, heading, prefix ) { |
| 682 |
return $( heading ).attr( "id" ) || ( prefix + i ); |
| 683 |
}, |
| 684 |
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", |
| 685 |
showAndHide : false, |
| 686 |
smoothScrolling: true |
| 687 |
} ); |
| 688 |
|
| 689 |
$( "#main span[id^='toc']" ).addClass( "toc-shim" ); |
| 690 |
$( '.dropdown-toggle' ).dropdown(); |
| 691 |
|
| 692 |
$( "table" ).each( function () { |
| 693 |
var $this = $( this ); |
| 694 |
$this.addClass('table'); |
| 695 |
} ); |
| 696 |
|
| 697 |
} ); |
| 698 |
</script> |
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
<script type="text/javascript"> |
| 710 |
$(document).ready(function() { |
| 711 |
SearcherDisplay.init(); |
| 712 |
}); |
| 713 |
</script> |
| 714 |
|
| 715 |
|
| 716 |
</body> |
| 717 |
</html> |