mirror of
https://github.com/nikdoof/ohayodash.git
synced 2025-12-13 18:12:17 +00:00
Make the date format user configurable
This commit is contained in:
@@ -18,6 +18,8 @@ image:
|
|||||||
env:
|
env:
|
||||||
# -- Set the container timezone
|
# -- Set the container timezone
|
||||||
TZ: UTC
|
TZ: UTC
|
||||||
|
# -- Python date format string to use for rendering the date/time
|
||||||
|
DATE_FORMAT: "%Y-%m-%d %H:%M"
|
||||||
|
|
||||||
# -- Configures service settings for the chart.
|
# -- Configures service settings for the chart.
|
||||||
# @default -- See values.yaml
|
# @default -- See values.yaml
|
||||||
|
|||||||
@@ -94,6 +94,11 @@ def get_greeting():
|
|||||||
return 'こんにちは'
|
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('/')
|
@base.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template('index.j2',
|
return render_template('index.j2',
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<section id="header">
|
<section id="header">
|
||||||
<h1>{{ greeting | default("Welcome")}}</h1>
|
<h1>{{ greeting | default("Welcome")}}</h1>
|
||||||
<h2>{{ now }}</h2>
|
<h2>{{ now | format_datetime }}</h2>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% if applications %}
|
{% if applications %}
|
||||||
|
|||||||
Reference in New Issue
Block a user