From 93b3a5dab6751c298abbc2771fdda1d82d42aada Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 14 Jun 2018 19:37:50 -0500 Subject: [PATCH] Change how date fields are handled within grid filters don't set type="date" b/c that can trigger native browser datepicker --- tailbone/grids/filters.py | 3 ++- tailbone/static/js/jquery.ui.tailbone.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tailbone/grids/filters.py b/tailbone/grids/filters.py index 7d355300..3b621159 100644 --- a/tailbone/grids/filters.py +++ b/tailbone/grids/filters.py @@ -86,7 +86,8 @@ class DateValueRenderer(FilterValueRenderer): """ def render(self, value=None, **kwargs): - return tags.text(self.name, value=value, type='date', **kwargs) + kwargs['data-datepicker'] = 'true' + return tags.text(self.name, value=value, **kwargs) class ChoiceValueRenderer(FilterValueRenderer): diff --git a/tailbone/static/js/jquery.ui.tailbone.js b/tailbone/static/js/jquery.ui.tailbone.js index bd1e2a6f..06904e59 100644 --- a/tailbone/static/js/jquery.ui.tailbone.js +++ b/tailbone/static/js/jquery.ui.tailbone.js @@ -357,7 +357,7 @@ }); // Enhance any date values with datepicker widget. - this.inputs.find('.value input[type="date"]').datepicker({ + this.inputs.find('.value input[data-datepicker="true"]').datepicker({ dateFormat: 'yy-mm-dd', changeYear: true, changeMonth: true