Little extra work on timezone config

hours-day-schedule
dgtlmoon 2 years ago
parent 2d948ea6d1
commit fedb16c242

@ -721,13 +721,19 @@ def changedetection_app(config=None, datastore_o=None):
else:
flash("An error occurred, please see below.", "error")
import datetime
datetime = datetime.datetime.now(pytz.timezone(datastore.data['settings']['application'].get('timezone')))
output = render_template("settings.html",
form=form,
current_base_url = datastore.data['settings']['application']['base_url'],
hide_remove_pass=os.getenv("SALTED_PASS", False),
api_key=datastore.data['settings']['application'].get('api_access_token'),
current_base_url=datastore.data['settings']['application']['base_url'],
datetime=str(datetime),
emailprefix=os.getenv('NOTIFICATION_MAIL_BUTTON_PREFIX', False),
settings_application=datastore.data['settings']['application'])
form=form,
hide_remove_pass=os.getenv("SALTED_PASS", False),
settings_application=datastore.data['settings']['application'],
timezone=datastore.data['settings']['application'].get('timezone')
)
return output

@ -40,7 +40,7 @@ class model(dict):
'password': False,
'render_anchor_tag_content': False,
'schema_version' : 0,
'timezone': None,
'timezone': 'UTC',
'webdriver_delay': None, # Extra delay in seconds before extracting text
}
}

@ -175,7 +175,12 @@ nav
<fieldset>
<div class="field-group">
{{ render_field(form.application.form.timezone) }}
Current Date / Time and timezone is <br/>
</div>
<div class="field-group">
<p>
<label>Local time</label> {{ datetime }}<br/>
<label>Configured timezone:</label> {{ timezone }}<br/>
</p>
</div>
</fieldset>
</div>

Loading…
Cancel
Save