From 6803e5187f878dba9e0f661e8688e45342932899 Mon Sep 17 00:00:00 2001 From: Rodrigo Ferreira de Souza Date: Tue, 25 Sep 2018 12:19:53 -0300 Subject: [PATCH 1/3] Fix daypicker URL --- src/brasil/gov/agenda/browser/mixin.py | 5 +++-- src/brasil/gov/agenda/browser/templates/agenda_macros.pt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/brasil/gov/agenda/browser/mixin.py b/src/brasil/gov/agenda/browser/mixin.py index 9d77c4e..105b394 100644 --- a/src/brasil/gov/agenda/browser/mixin.py +++ b/src/brasil/gov/agenda/browser/mixin.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from six.moves import range # noqa: I001 +from brasil.gov.agenda.config import AGENDADIARIAFMT from datetime import timedelta from plone import api from zope.component import getMultiAdapter @@ -44,15 +45,15 @@ def days(self): has_appointment = False if day == self.date: cssclass.append('is-selected') - if self.agenda.get(day.strftime('%Y-%m-%d'), False): + if self.agenda.get(day.strftime(AGENDADIARIAFMT), False): has_appointment = True cssclass.append('has-appointment') # Weekday difference between datetime and DateTime objects strweek = self._translate(tool.day_msgid((day.weekday() + 1) % 7)) weekdays.append({ 'day': day.day, + 'dayurl': day.strftime(AGENDADIARIAFMT), 'weekday': strweek[:3], - 'iso': day.isoformat(), 'cssclass': ' '.join(cssclass), 'hasappointment': has_appointment, }) diff --git a/src/brasil/gov/agenda/browser/templates/agenda_macros.pt b/src/brasil/gov/agenda/browser/templates/agenda_macros.pt index 7270f6b..abc97fb 100644 --- a/src/brasil/gov/agenda/browser/templates/agenda_macros.pt +++ b/src/brasil/gov/agenda/browser/templates/agenda_macros.pt @@ -28,9 +28,9 @@