0.0.14 • Published 9 years ago

dustjs-helper-daterange v0.0.14

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

daterange helper

Loop over a date range providing information for each day inside the loop

Definition

{@daterange start="2014-06-25" end="2015-06-25" length="14" lan="en-US" firstDay="0"
  formatDay="D" formatMonth="M" formatYear="YY" formatWeekday="d"
  formatDayExt="DD" formatMonthExt="MM" formatYearExt="YYYY" formatWeekdayExt="dddd"}
{/daterange}

If length is defined end will be overwritten with start + length days.

Examples

{@daterange start="2014-06-25" end="2015-06-25"}
{?$newMonth}
  {^$first}</ul>{/$first}
  {?$newYear}
    {^$first}</div>{/$first}
    <h1>{$yearExt}</h1>
    <div class="year">
  {/$newYear}
  <h2>{$monthExt}</h2>
  <ul>
{/$newMonth}

<li>
  {$key}. {$day}-{$month}-{$year}, 
  {$weekdayExt} - {$weekday} of the week ({$newWeek}),
  {$yearsPassed} years, {$monthsPassed} months, {$weeksPassed} weeks
</li>
{/daterange}

Usage

Depends on dustjs-helpers module to be loaded first since it adds it's definition to the the dust.helpers property.

In node.js: require('dustjs-helper-daterange');

In browser:

If not using require, load the JS some other way and call it with the dust object. As noted earlier, dustjs-helpers must be loaded earlier.

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago