From f38b9c6f22b82327df9648938a5a4bcf863d8c41 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Mon, 20 Apr 2020 11:52:47 -0700 Subject: Use a date picker for any string 'date' --- bh20simplewebuploader/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 34dc354..ceab8a6 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -183,7 +183,13 @@ def generate_form(schema, options): # Make a tuple for each one record['options'].append((name, value)) elif field_type == 'string': - record['type'] = 'text' # HTML input type + if field_name.endswith('date'): + # Use a date picker to generate a good string. + # Comes back YYYY-MM-DD. + record['type'] = 'date' + else: + # Normal text string + record['type'] = 'text' elif field_type == 'int': record['type'] = 'number' elif field_type == 'float': -- cgit v1.2.3