From 7a46e7f1fa592658415e0da4fe42033a31ce3951 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 23 Nov 2017 18:30:04 +0100 Subject: new account, date field, fixed --- StoneIsland/www/js/lib/view/Serializable.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'StoneIsland/www/js/lib/view/Serializable.js') diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js index fa4eba02..ae0a4fbc 100755 --- a/StoneIsland/www/js/lib/view/Serializable.js +++ b/StoneIsland/www/js/lib/view/Serializable.js @@ -42,7 +42,7 @@ var SerializableView = View.extend({ this.$("input[name], select[name], textarea[name]").each( function(){ if (this.type == "checkbox") { if ($(this).prop("checked")) { - fields[this.name] = this.value + fields[this.name] = this.value || "true" } } else { @@ -77,6 +77,9 @@ var SerializableView = View.extend({ update_date: function(e){ var $target = $(e.currentTarget), value = $target.val() var label = moment(value).format("MM/DD/YYYY") + if (label === 'Invalid date') { + label = 'BIRTHDAY (OPTIONAL)' + } $target.parent().addClass("picked") $target.parent().find("span").html(label) }, @@ -128,7 +131,7 @@ var SerializableView = View.extend({ } else { this.hide_errors() - cordova.plugins.Keyboard.close() + window.cordova && cordova.plugins.Keyboard.close() } var finalized_data = this.finalize(valid.data) -- cgit v1.2.3-70-g09d2