details:   https://code.openbravo.com/erp/devel/pi/rev/0efeacc08e9c
changeset: 16869:0efeacc08e9c
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Jun 19 15:23:47 2012 +0200
summary:   fixed bug 20790: Default to current time when selecting date-time 
with calendar

  DateTime reference now defaults current time when a date is selected, behaving
  in this way as it did in 2.50.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
 |  11 ++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r c0686afd1db5 -r 0efeacc08e9c 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
    Tue Jun 19 12:41:24 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
    Tue Jun 19 15:23:47 2012 +0200
@@ -149,5 +149,16 @@
     if (completedDate !== oldValue) {
       item.setValue(completedDate);
     }
+  },
+
+  pickerDataChanged: function (picker) {
+    var date, now = new Date();
+    this.Super('pickerDataChanged', arguments);
+
+    // SC sets time to local 0:00 to date in pickerDataChanged method
+    // setting now current time
+    date = this.getValue();
+    date.setHours(now.getHours(), now.getMinutes(), now.getSeconds());
+    this.setValue(date);
   }
 });
\ No newline at end of file

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to