details:   https://code.openbravo.com/erp/devel/pi/rev/4083ef59b102
changeset: 23088:4083ef59b102
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Wed May 21 23:58:53 2014 +0200
summary:   Related to issue 25936 and Fixed issue 26644: Removed custom function
'endsWith' implemented by Smartclint to ensure that standalone files work 
properly with other libraries

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
 |  2 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
        |  4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 2e94293e0e22 -r 4083ef59b102 
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
    Wed May 21 18:40:37 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
    Wed May 21 23:58:53 2014 +0200
@@ -137,7 +137,7 @@
     } else {
       this.showPickerTimeItem = false;
     }
-    if (OB.Format.dateTime.toUpperCase().endsWith(' A')) {
+    if (OB.Format.dateTime.toUpperCase().lastIndexOf(' A') !== -1 && 
OB.Format.dateTime.toUpperCase().lastIndexOf(' A') === 
OB.Format.dateTime.length - 2) {
       this.use24HourTime = false;
     } else {
       this.use24HourTime = true;
diff -r 2e94293e0e22 -r 4083ef59b102 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
   Wed May 21 18:40:37 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
   Wed May 21 23:58:53 2014 +0200
@@ -80,7 +80,7 @@
 
   timeFormat = OB.Format.dateTime.substring(OB.Format.dateTime.indexOf(' ') + 
1);
 
-  if (timeFormat && timeFormat.toLowerCase().endsWith('a')) {
+  if (timeFormat && timeFormat.toUpperCase().lastIndexOf(' A') !== -1 && 
timeFormat.toUpperCase().lastIndexOf(' A') === timeFormat.length - 2) {
     is24h = false;
   }
 
@@ -238,7 +238,7 @@
   if (!isADate) {
     return null;
   }
-  if (dateFormat.toUpperCase().endsWith(' A')) {
+  if (dateFormat.toUpperCase().lastIndexOf(' A') !== -1 && 
dateFormat.toUpperCase().lastIndexOf(' A') === dateFormat.length - 2) {
     is24h = false;
   }
 

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to