Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UTC timezone to xml #360

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions qgis-app/plugins/templates/plugins/plugins.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load static %}<?xml version = '1.0' encoding = 'UTF-8'?>
{% load static %}{% load local_timezone %}<?xml version = '1.0' encoding = 'UTF-8'?>
<?xml-stylesheet type="text/xsl" href="{% static "style/plugins.xsl" %}" ?>
<plugins>
{% for version in object_list %}<pyqgis_plugin name="{{version.plugin.name}}" version="{{ version.version }}" plugin_id="{{version.plugin.id }}">
Expand All @@ -14,8 +14,8 @@
<author_name><![CDATA[{% firstof version.plugin.author version.plugin.created_by %}]]></author_name>
<download_url>{% if request.is_secure %}https{% else %}http{% endif %}://{{ request.get_host }}{{ version.get_download_url }}</download_url>
<uploaded_by><![CDATA[{{ version.created_by }}]]></uploaded_by>
<create_date>{{ version.plugin.created_on.isoformat }}</create_date>
<update_date>{{ version.created_on.isoformat }}</update_date>
<create_date>{{ version.plugin.created_on|local_timezone:"WITH-UTC" }}</create_date>
<update_date>{{ version.created_on|local_timezone:"WITH-UTC" }}</update_date>
<experimental>{% if version.experimental %}True{% else%}False{% endif %}</experimental>
<deprecated>{{ version.plugin.deprecated }}</deprecated>
<tracker><![CDATA[{{ version.plugin.tracker }}]]></tracker>
Expand Down
2 changes: 2 additions & 0 deletions qgis-app/plugins/templatetags/local_timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def local_timezone(date, args="LONG"):
result = '<span class="user-timezone-short">%s</span>' % (utcdate,)
elif args and str(args) == "SHORT_NATURAL_DAY":
result = '<span class="user-timezone-short-naturalday">%s</span>' % (utcdate,)
elif args and str(args) == "WITH-UTC":
result = utcdate
else:
result = '<span class="user-timezone">%s</span>' % (utcdate,)
except AttributeError:
Expand Down
Loading