show dates everywhere with user timezone

This commit is contained in:
Philippe Loctaux 2023-04-15 10:52:12 +02:00
parent 12eccde4ea
commit 16dfe7bfb2
5 changed files with 5 additions and 2 deletions

View file

@ -40,6 +40,7 @@ pub mod content {
pub email: Option<String>,
pub timezone: String,
pub list_timezones: Vec<&'static str>,
pub updated_at: String,
}
#[derive(Serialize)]

View file

@ -30,6 +30,7 @@ pub async fn user_settings_personal(
email: user.email().map(String::from),
timezone: user.timezone().into(),
list_timezones: timezones,
updated_at: user.updated_at().to_string(),
});
Ok(flash

View file

@ -85,7 +85,7 @@
{% endif %}
</td>
<td class="sort-creation-date" data-date='{{ app.created_at | date(format="%s") }}'>
{{ app.created_at | date() }}
{{ app.created_at | date(format="%F", timezone=user.zoneinfo | default(value="UTC")) }}
</td>
<td class="sort-id">{{ app.id }}</td>
<td class="sort-confidentiality">

View file

@ -66,7 +66,7 @@
</div>
</div>
<p class="mt-4 text-muted">Settings last updated on {{ updated_at | date(format="%A %-d %B %Y") }}</p>
<p class="mt-4 text-muted">Settings last updated on {{ updated_at | date(format="%A %-d %B %Y, %T", timezone=user.zoneinfo | default(value="UTC")) }}</p>
</div>
<!-- Save -->

View file

@ -98,6 +98,7 @@
</select>
</div>
<p class="mt-4 text-muted">Profile last updated on {{ updated_at | date(format="%A %-d %B %Y, %T", timezone=user.zoneinfo | default(value="UTC")) }}</p>
</div>
<div class="card-footer text-end">