Commit 460d607 1 parent 235951b commit 460d607 Copy full SHA for 460d607
File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 4
4
use std:: borrow:: Borrow ;
5
5
use time:: format_description:: well_known:: Rfc3339 ;
6
6
7
- pub fn format_time ( s : time:: OffsetDateTime ) -> Result < String , askama:: Error > {
8
- s. format ( & Rfc3339 )
7
+ pub fn format_time ( s : impl Borrow < time:: OffsetDateTime > ) -> Result < String , askama:: Error > {
8
+ ( * s. borrow ( ) )
9
+ . format ( & Rfc3339 )
9
10
. map_err ( Box :: from)
10
11
. map_err ( askama:: Error :: Custom )
11
12
}
Original file line number Diff line number Diff line change 44
44
</ td >
45
45
< td >
46
46
< a href ="/{% if let Some(path) = path %}{{ path }}/{% endif %}{{ repository.name }} ">
47
- < time datetime ="{{ repository.last_modified }} " title ="{{ repository.last_modified }} ">
47
+ < time datetime ="{{ repository.last_modified|format_time }} " title ="{{ repository.last_modified|format_time }} ">
48
48
{{- repository.last_modified.clone()|timeago -}}
49
49
</ time >
50
50
</ a >
Original file line number Diff line number Diff line change 18
18
{{ commit.get().author.name }}
19
19
</ td >
20
20
< td >
21
- < time datetime ="{{ commit.get().author.time }} " title ="{{ commit.get().author.time }} ">
21
+ < time datetime ="{{ commit.get().author.time|format_time }} " title ="{{ commit.get().author.time|format_time }} ">
22
22
{{- commit.get().author.time|timeago -}}
23
23
</ time >
24
24
</ td >
50
50
</ td >
51
51
< td >
52
52
{% if let Some(tagger) = tag.get().tagger -%}
53
- < time datetime ="{{ tagger.time }} " title ="{{ tagger.time }} ">
53
+ < time datetime ="{{ tagger.time|format_time }} " title ="{{ tagger.time|format_time }} ">
54
54
{{- tagger.time|timeago -}}
55
55
</ time >
56
56
{%- endif %}
74
74
{% set commit = commit.get() %}
75
75
< tr >
76
76
< td >
77
- < time datetime ="{{ commit.committer.time }} " title ="{{ commit.committer.time }} ">
77
+ < time datetime ="{{ commit.committer.time|format_time }} " title ="{{ commit.committer.time|format_time }} ">
78
78
{{- commit.committer.time.clone()|timeago -}}
79
79
</ time >
80
80
</ td >
You can’t perform that action at this time.
0 commit comments