rbrindley: branch rbrindley/astman_revamp r4610 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Mar 11 12:47:13 CDT 2009


Author: rbrindley
Date: Wed Mar 11 12:47:10 2009
New Revision: 4610

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

- implemented pbx.time_intervals.validate.day
- implemented pbx.time_intervals.validate.month


Modified:
    team/rbrindley/astman_revamp/config/js/pbx2.js

Modified: team/rbrindley/astman_revamp/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/pbx2.js?view=diff&rev=4610&r1=4609&r2=4610
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Wed Mar 11 12:47:10 2009
@@ -344,6 +344,37 @@
 	days: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
 	months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
 
+};
+
+/**
+ * Validates day format.
+ * @param day The day to be checked.
+ * @return boolean on valid format.
+ */
+pbx.time_intervals.validate.day = function (day) {
+	if (day === '*') {
+		return true;
+	}
+
+	day = parseInt(day, 10);
+	if (day >= 0 && day <= 31) {
+		return true;
+	}
+
+	return false;
+};
+
+/**
+ * Validates month format.
+ * @param month The month to be checked.
+ * @return boolean on valid format.
+ */
+pbx.time_intervals.validate.month = function (month) {
+	if (month === '*' || this.months.contains(month)) {
+		return true;
+	}
+
+	return false;
 };
 
 /**




More information about the asterisk-gui-commits mailing list