about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdam Novak2020-04-20 11:52:47 -0700
committerAdam Novak2020-04-20 11:52:47 -0700
commitf38b9c6f22b82327df9648938a5a4bcf863d8c41 (patch)
tree67009c33930672085bfc2a6f857b202fb0b4973e
parent3bd4ac02ded5af9a666ad7e99ebf6891bc339636 (diff)
downloadbh20-seq-resource-f38b9c6f22b82327df9648938a5a4bcf863d8c41.tar.gz
bh20-seq-resource-f38b9c6f22b82327df9648938a5a4bcf863d8c41.tar.lz
bh20-seq-resource-f38b9c6f22b82327df9648938a5a4bcf863d8c41.zip
Use a date picker for any string 'date'
-rw-r--r--bh20simplewebuploader/main.py8
1 files changed, 7 insertions, 1 deletions
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':