mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: centralize datetime generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
7bcc8d7ce7
commit
7f6c23d4cb
41 changed files with 146 additions and 179 deletions
|
@ -1,9 +1,7 @@
|
|||
import copy
|
||||
import functools
|
||||
import os
|
||||
import zoneinfo
|
||||
|
||||
from datetime import datetime
|
||||
from http import HTTPStatus
|
||||
from typing import Callable
|
||||
|
||||
|
@ -80,8 +78,8 @@ def make_context(request: Request, title: str, next: str = None):
|
|||
"timezone": timezone,
|
||||
"timezones": time.SUPPORTED_TIMEZONES,
|
||||
"title": title,
|
||||
"now": datetime.now(tz=zoneinfo.ZoneInfo(timezone)),
|
||||
"utcnow": int(datetime.utcnow().timestamp()),
|
||||
"now": time.now(timezone),
|
||||
"utcnow": time.utcnow(),
|
||||
"config": aurweb.config,
|
||||
"creds": aurweb.auth.creds,
|
||||
"next": next if next else request.url.path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue