File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,9 @@ Fixed:
375375 space separated list not comma separated. This fixes the format of
376376 the id url parameter when generated by indexargs_form. (John
377377 Rouillard)
378+ - issue2550932 - html_calendar produces templating errors for bad date
379+ strings. Fixed to ignore bad date and highlight todays date in the
380+ calendar popup.
378381
3793822016-01-11: 1.5.1
380383
Original file line number Diff line number Diff line change @@ -3031,8 +3031,19 @@ def html_calendar(self, request):
30313031 template = request .form .getfirst ("@template" , "calendar" )
30323032 form = request .form .getfirst ("form" )
30333033 property = request .form .getfirst ("property" )
3034- curr_date = date .Date (date_str ) # to highlight
3035- display = date .Date (display ) # to show
3034+ curr_date = ""
3035+ try :
3036+ # date_str and display can be set to an invalid value
3037+ # if user submits a value like "d4" and gets an edit error.
3038+ # If either or both invalid just ignore that we can't parse it
3039+ # and assign them to today.
3040+ curr_date = date .Date (date_str ) # to highlight
3041+ display = date .Date (display ) # to show
3042+ except ValueError :
3043+ # we couldn't parse the date
3044+ # just let the calendar display
3045+ curr_date = current_date
3046+ display = current_date
30363047 day = display .day
30373048
30383049 # for navigation
You can’t perform that action at this time.
0 commit comments