rbrindley: branch 2.0 r4519 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Feb 18 11:14:05 CST 2009


Author: rbrindley
Date: Wed Feb 18 11:14:05 2009
New Revision: 4519

URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4519
Log:

- grouped or (||) statements together, as it was either or condition in AMPM_to_asteriskTime function
- changed minute checker to be 59 instead of 60 in AMPM_to_asteriskTime function

(closes issue #14466)
Reported by: timeshell
Tested by: timeshell, awk


Modified:
    branches/2.0/config/js/astman.js

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4519&r1=4518&r2=4519
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed Feb 18 11:14:05 2009
@@ -1516,10 +1516,10 @@
 			//match[3] is the whitespace plus match[4]
 			ampm = match[4] || null;
 
-			if (!ampm && hour < 0 || hour > 23) {
+			if (!ampm && (hour < 0 || hour > 23)) {
 				ASTGUI.Log.Debug('ampmTime must have its hour inbetween 0 and 23.');
 				return '';
-			} else if (ampm && hour < 0 || hour > 12) {
+			} else if (ampm && (hour < 0 || hour > 12)) {
 				ASTGUI.Log.Debug('ampmTime must have its hour inbetween 0 and 12 if "AM|PM" exists');
 				return '';
 			} else if (ampm) {
@@ -1527,10 +1527,10 @@
 					hour+=12;
 				}
 			}
-			hour = hour < 10 ? hour.addZero() : hour;
-
-			if (minute < 0 || minute > 60) {
-				ASTGUI.Log.Debug('ampmTime must have its minute inbetween 0 and 60');
+			hour = (hour < 10) ? hour.addZero() : hour;
+
+			if (minute < 0 || minute > 59) {
+				ASTGUI.Log.Debug('ampmTime must have its minute inbetween 0 and 59');
 				return '';
 			}
 			minute = minute < 10 ? minute.addZero() : minute;




More information about the asterisk-gui-commits mailing list