Skip to content

Commit 9f9efb6

Browse files
Remove date filter
1 parent c0f1766 commit 9f9efb6

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/web/page/templates.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,9 @@ pub mod filters {
230230
Ok(((multiplier * *value).round() / multiplier).to_string())
231231
}
232232

233-
pub fn date(value: &DateTime<Utc>, format: &str) -> rinja::Result<String> {
234-
Ok(format!("{}", value.format(format)))
235-
}
236-
237233
pub fn opt_date(value: &Option<DateTime<Utc>>, format: &str) -> rinja::Result<String> {
238234
if let Some(value) = value {
239-
date(value, format)
235+
Ok(value.format(format).to_string())
240236
} else {
241237
Ok(String::new())
242238
}

templates/core/home.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1 class="brand">{{ "cubes"|fas(false, false, "") }} Docs.rs</h1>
6262

6363
{%- if let Some(build_time) = release.build_time -%}
6464
<div class="pure-u-1 pure-u-sm-4-24 pure-u-md-3-24 date"
65-
title="{{ build_time|date("%FT%TZ") }}">
65+
title="{{ build_time.format("%FT%TZ") }}">
6666
{{ build_time|timeformat }}
6767
</div>
6868
{%- endif -%}

templates/crate/build_details.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="container">
2323
<div class="recent-releases-container">
2424
<div class="release">
25-
<strong>Build #{{ build_details.id }} {%- if let Some(build_time) = build_details.build_time %} {{ build_time|date("%+") }}{% endif %}</strong>
25+
<strong>Build #{{ build_details.id }} {%- if let Some(build_time) = build_details.build_time %} {{ build_time.format("%+") }}{% endif %}</strong>
2626
</div>
2727

2828
<ul>

templates/releases/releases.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</div>
6969
{%- elif let Some(build_time) = release.build_time -%}
7070
<div class="pure-u-1 pure-u-sm-4-24 pure-u-md-3-24 date"
71-
title="{{ build_time|date("%FT%TZ") }}">
71+
title="{{ build_time.format("%FT%TZ") }}">
7272
{{ build_time|timeformat }}
7373
</div>
7474
{%- else -%}

0 commit comments

Comments
 (0)