Dotiac

 view release on metacpan or  search on metacpan

lib/Dotiac/DTL/Filter.pm  view on Meta::CPAN

=item "t"

Returns the number of days in the given month.

	{{ var|date: "t" }} {# 28 #} to  {# 31 #}

=item "T"

Returns the current timezone (needs the POSIX module)

	{{ var|date: "T" }} {# CET #} {# GMT #} {# EST #}...

=item "w"

Returns the day of week as a number from 0 (Sunday) to 6 (Saturday)

	{{ var|date: "w" }} {# 1 #} to {# 6 #}

=item "W"

Returns the ISO-8601 week number of year (uses the POSIX module), weeks start on monday.

lib/Dotiac/DTL/Filter.pm  view on Meta::CPAN

=head3 Bugs and Differences to Django

Since Perl has no default DateTime Object, this expects a normal unix timestamp ( result of the time() call in perl).

It also excepts the result of localtime as an array reference, this is useful for timestamps > 2038 on 32-Bit machines.

	var=>[36,31,21,2,0,109,5,1,0];
	
	{{ var|time:"H:i" }} {# 21:31 #}

=head2 timesince :REFERNCETIME

Formats a time value and displays the time since REFERENCE TIME has passed.

REFERENCETIME is C<now> if it is omitted

If you have a past event and want to display the time since then you can use this filter.

For any time in the future it will return 0 Minutes

	{{ post.date|timesince }} {# 3 years #}
	{{ post.date|timesince:edit.date }} {# 3 minutes #} {# after the post #}

C<timesince> and C<timeuntil> only differ in the order of the arguments:

lib/Dotiac/DTL/Filter.pm  view on Meta::CPAN


If given any additional parameter it will print out the full time, while without it will only print useful information

	{{ post.date|timesice:edit.date;"" }} {# 2 days 3 Minutes #}
	{{ post.date|timesice:"now";"" }} {# 3 years 2 days 2 seconds #} {# compare to current time #}

If you have just a elapsed time in seconds you can use this:

	{{ "0"|timesince:"60" }} {# 1 Minute #}

=head2 timeuntil :REFERNCETIME

Formats a time value and displays the time util REFERENCE TIME.

REFERENCETIME is C<now> if it is omitted.

If you have a funture event and want to display the time util then you can use this filter

For any time in the past it will return 0 Minutes

	{{ marriage.date|timeuntil }} {# 3 years #}
	{{ marriage.date|timeuntil:engagement.date }} {# 3 month #} {# after the engagement #}

C<timesince> and C<timeuntil> only differ in the order of the arguments:

lib/Dotiac/DTL/Tag/now.pm  view on Meta::CPAN

=item "t"

Returns the number of days in the given month.

	{% now "t" %} {# 28 #} to  {# 31 #}

=item "T"

Returns the current timezone (needs the POSIX module)

	{% now "T" %} {# CET #} {# GMT #} {# EST #}...

=item "w"

Returns the day of week as a number from 0 (Sunday) to 6 (Saturday)

	{% now "w" %} {# 1 #} to {# 6 #}

=item "W"

Returns the ISO-8601 week number of year (uses the POSIX module), weeks start on monday.



( run in 0.819 second using v1.01-cache-2.11-cpan-49f99fa48dc )