mirror of
https://github.com/nikdoof/ohayodash.git
synced 2025-12-23 14:59:25 +00:00
Make the date format user configurable
This commit is contained in:
@@ -94,6 +94,11 @@ def get_greeting():
|
||||
return 'こんにちは'
|
||||
|
||||
|
||||
@base.app_template_filter()
|
||||
def format_datetime(value, format='medium'):
|
||||
return value.strftime(os.environ.get('DATE_FORMAT', '%Y-%m-%d %H:%M')) # noqa: WPS323
|
||||
|
||||
|
||||
@base.route('/')
|
||||
def index():
|
||||
return render_template('index.j2',
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<section id="header">
|
||||
<h1>{{ greeting | default("Welcome")}}</h1>
|
||||
<h2>{{ now }}</h2>
|
||||
<h2>{{ now | format_datetime }}</h2>
|
||||
</section>
|
||||
|
||||
{% if applications %}
|
||||
|
||||
Reference in New Issue
Block a user