Fix #274 -- Disable weekends in datetimepicker for expiry (#320)

* Fix for Disable weekends in datetimepicker for expiry #274

* minor fixes from review
This commit is contained in:
Christopher Dambamuromo
2016-11-17 21:39:48 +00:00
committed by Raphael Michel
parent 94461b36ba
commit bac9960d0c
5 changed files with 15 additions and 4 deletions

View File

@@ -27,10 +27,14 @@ def contextprocessor(request):
_html_head.append(response)
ctx['html_head'] = "".join(_html_head)
_js_payment_weekdays_disabled = '[]'
_nav_event = []
if hasattr(request, 'event'):
for receiver, response in nav_event.send(request.event, request=request):
_nav_event += response
if request.event.settings.get('payment_term_weekdays'):
_js_payment_weekdays_disabled = '[0,6]'
ctx['js_payment_weekdays_disabled'] = _js_payment_weekdays_disabled
ctx['nav_event'] = _nav_event
ctx['js_datetime_format'] = get_javascript_format('DATETIME_INPUT_FORMATS')