class Marten::Template::Tag::LocalTime

Overview

The local_time template tag.

The local_time template tag allows to output the string representation of the local time. It must be take one argument (the pattern used to output the time). For example the following lines are valid usages of the local_time tag:

{% local_time "%Y" %}
{% local_time "%Y-%m-%d %H:%M:%S %:z" %}

Optionally, the output of this tag can be assigned to a specific variable using the as keyword:

{% local_time "%Y" as current_year %}

Included Modules

Defined in:

marten/template/tag/local_time.cr

Constructors

Instance Method Summary

Instance methods inherited from module Marten::Template::Tag::CanSplitSmartly

split_smartly(expression : String) : Array(String) split_smartly

Instance methods inherited from class Marten::Template::Tag::Base

render(context : Context) : String render

Constructor methods inherited from class Marten::Template::Tag::Base

new(parser : Parser, source : String) new

Constructor Detail

def self.new(parser : Parser, source : String) #

[View source]

Instance Method Detail

def render(context : Context) : String #
Description copied from class Marten::Template::Tag::Base

Render the template tag for a given context.


[View source]