From de338276c0ea8d7463fa9626912d562df36563b0 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sun, 3 Nov 2013 08:40:37 -0500 Subject: [PATCH] Couldn't edit in columns, assign date correctly --- app/assets/javascripts/custom_netzke_helpers.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/custom_netzke_helpers.js b/app/assets/javascripts/custom_netzke_helpers.js index c1ba9bf..cd5bd34 100644 --- a/app/assets/javascripts/custom_netzke_helpers.js +++ b/app/assets/javascripts/custom_netzke_helpers.js @@ -140,7 +140,7 @@ Ext.define('Ext.ux.form.field.DateTime', { mixins:{ field:'Ext.form.field.Field' }, - alias: 'widget.xdateampmtime', + alias: 'widget.xdatetime', //configurables @@ -320,9 +320,15 @@ Ext.define('Ext.ux.form.field.DateTime', { }, setValue: function(value){ - if (Ext.isString(value)){ - dt = new Date(value); - value = Ext.Date.parse(value, this.getFormat()); //this.dateTimeFormat + console.log("setValue: " + value); + if (Ext.isString(value) || Ext.isDate(value)){ + + if( Ext.isDate(value)){ + dt = value; + }else{ + dt = new Date(value); + value = Ext.Date.parse(value, this.getFormat()); //this.dateTimeFormat + } this.dateField.setValue(value); hour = Ext.Date.format(dt, 'g');