details: https://code.openbravo.com/erp/devel/pi/rev/81ef510917bd
changeset: 22872:81ef510917bd
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Mon Apr 14 17:13:43 2014 +0200
summary: Fixed issue 26273: Absolute DateTime picker now shows the proper
date value
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
| 21 ++++++---
1 files changed, 14 insertions(+), 7 deletions(-)
diffs (38 lines):
diff -r e38cdd54b4f3 -r 81ef510917bd
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
Mon Apr 14 16:48:05 2014 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
Mon Apr 14 17:13:43 2014 +0200
@@ -328,20 +328,27 @@
},
getPickerData: function () {
- var date = this.getValue();
+ var date = this.getValue(),
+ utcDate, utcMonth, utcFullYear, utcHours, utcMinutes, utcSeconds;
// To visualize in the calendar the displayed value instead of internal
value, since due to the GMT difference it can be in a different day
if (this.isAbsoluteDateTime && isc.isA.Date(date)) {
+ utcDate = date.getUTCDate();
+ utcMonth = date.getUTCMonth();
+ utcFullYear = date.getUTCFullYear();
+ utcHours = date.getUTCHours();
+ utcMinutes = date.getUTCMinutes();
+ utcSeconds = date.getUTCSeconds();
// Set the month initially to January to prevent error like this
// provided date: 15/02/2014
// today: 31/03/2014
// date.setDate(today.getDate()) would result in Mon Mar 02 2014
18:00:00 GMT+0100 (CET), because February does not have 31 days
date.setMonth(0);
- date.setDate(date.getUTCDate());
- date.setMonth(date.getUTCMonth());
- date.setFullYear(date.getUTCFullYear());
- date.setHours(date.getUTCHours());
- date.setMinutes(date.getUTCMinutes());
- date.setSeconds(date.getUTCSeconds());
+ date.setDate(utcDate);
+ date.setMonth(utcMonth);
+ date.setFullYear(utcFullYear);
+ date.setHours(utcHours);
+ date.setMinutes(utcMinutes);
+ date.setSeconds(utcSeconds);
}
if (isc.isA.Date(date)) {
return date;
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits