More documentation and tests
diff --git a/dev/js/src/datepicker.js b/dev/js/src/datepicker.js
index 8608efe..9882364 100644
--- a/dev/js/src/datepicker.js
+++ b/dev/js/src/datepicker.js
@@ -39,6 +39,7 @@
       return this;
     },
 
+
     /**
      * Get or select a specific date.
      */
@@ -80,6 +81,7 @@
       this._click = cb;
     },
 
+
     /**
      * Show the datepicker.
      * Will either show the selected year/month
@@ -111,6 +113,7 @@
       return this._element;
     },
 
+
     /**
      * Get the HTML element associated with the datepicker.
      */
@@ -118,6 +121,7 @@
       return this._element;
     },
 
+
     /**
      * Get the current date in string format.
      */
@@ -131,28 +135,37 @@
       return str;
     },
 
+
     /**
      * Increment the year.
      */
     incrYear : function () {
-      this._showYear++;
-      this._updateYear();
-      this._updateMonth();
-      this._updateDay();
+      if (this._showYear < 9999) {
+	this._showYear++;
+	this._updateYear();
+	this._updateMonth();
+	this._updateDay();
+	return this;
+      };
       return;
     },
 
+
     /**
      * Decrement the year.
      */
     decrYear : function () {
-      this._showYear--;
-      this._updateYear();
-      this._updateMonth();
-      this._updateDay();
+      if (this._showYear > 0) {
+	this._showYear--;
+	this._updateYear();
+	this._updateMonth();
+	this._updateDay();
+	return this;
+      };
       return;
     },
 
+
     /**
      * Increment the month.
      */
@@ -166,8 +179,10 @@
 	this._updateMonth();
 	this._updateDay();
       };
+      return this;
     },
 
+
     /**
      * Decrement the month.
      */
@@ -181,6 +196,8 @@
 	this._updateMonth();
 	this._updateDay();
       };
+
+      return this;
     },