github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/components/view/Timestamp.html (about) 1 <!-- Content managed by Project Forge, see [projectforge.md] for details. --> 2 {% import ( 3 "time" 4 5 "github.com/kyleu/dbaudit/app/util" 6 ) %} 7 8 {% func Timestamp(value *time.Time) %}{% stripspace %} 9 <span class="timestamp nowrap" data-timestamp="{%s util.TimeToJS(value) %}">{%s util.TimeToFull(value) %}</span> 10 {% endstripspace %}{% endfunc %} 11 12 {% func TimestampMillis(value *time.Time) %}{% stripspace %} 13 <span class="timestamp millis nowrap" data-timestamp="{%s util.TimeToRFC3339(value) %}">{%s util.TimeToFullMS(value) %}</span> 14 {% endstripspace %}{% endfunc %} 15 16 {% func TimestampRelative(value *time.Time, static bool) %}{% stripspace %} 17 <span class="{% if !static %}reltime{% space %}{% endif %}nowrap" data-timestamp="{%s util.TimeToFull(value) %}">{%s util.TimeRelative(value) %}</span> 18 {% endstripspace %}{% endfunc %} 19 20 {% func TimestampDay(value *time.Time) %}{% stripspace %} 21 {%s util.TimeToYMD(value) %} 22 {% endstripspace %}{% endfunc %}