Skip to content
Snippets Groups Projects
Commit 3ea5481a authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'fix-plan-timezone-now' into 'main'

Fix now indicator in fullcalendar views (AKPlan) for users from other timezones

See merge request !109
parents f478e92b 50be5c48
No related branches found
No related tags found
1 merge request!109Fix now indicator in fullcalendar views (AKPlan) for users from other timezones
Pipeline #23325 passed
{% load static %}
{% load tz %}
{% load i18n %}
{% load tags_AKPlan %}
{% include "AKPlan/load_fullcalendar.html" %}
......@@ -27,6 +28,7 @@
scrollTime: '08:00:00',
allDaySlot: false,
nowIndicator: true,
now: "{% timestamp_now event.timezone %}",
eventTextColor: '#fff',
eventColor: '#127ba3',
// Create entries for all scheduled slots
......
......@@ -4,6 +4,7 @@
{% load i18n %}
{% load static %}
{% load tz %}
{% load tags_AKPlan %}
{% block fullcalendar %}
......@@ -36,6 +37,7 @@
scrollTime: '08:00:00',
allDaySlot: false,
nowIndicator: true,
now: "{% timestamp_now event.timezone %}",
eventTextColor: '#fff',
eventColor: '#127ba3',
// Create entries for all scheduled slots
......
......@@ -4,6 +4,7 @@
{% load i18n %}
{% load static %}
{% load tz %}
{% load tags_AKPlan %}
{% block fullcalendar %}
......@@ -47,6 +48,7 @@
editable: false,
allDaySlot: false,
nowIndicator: true,
now: "{% timestamp_now event.timezone %}",
eventTextColor: '#fff',
eventColor: '#127ba3',
resourceAreaWidth: '15%',
......
......@@ -3,6 +3,7 @@
{% load bootstrap4 %}
{% load fontawesome_5 %}
{% load tags_AKModel %}
{% load tags_AKPlan %}
{% load tz %}
......@@ -43,6 +44,7 @@
editable: false,
allDaySlot: false,
nowIndicator: true,
now: "{% timestamp_now event.timezone %}",
eventTextColor: '#fff',
eventColor: '#127ba3',
height: '90%',
......
from datetime import datetime
from django import template
from django.utils.formats import date_format
from AKPlan.templatetags.color_gradients import darken
from AKPlanning import settings
......@@ -18,3 +21,8 @@ def highlight_change_colors(akslot):
recentness = seconds_since_update / settings.PLAN_MAX_HIGHLIGHT_UPDATE_SECONDS
return darken("#b71540", recentness)
# return linear_blend("#b71540", "#000000", recentness)
@register.simple_tag
def timestamp_now(tz):
return date_format(datetime.now().astimezone(tz), "c")
......@@ -138,6 +138,7 @@
},
allDaySlot: false,
nowIndicator: true,
now: "{% timestamp_now event.timezone %}",
eventTextColor: '#fff',
eventColor: '#127ba3',
eventBackgroundColor: '#28B62C',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment