Fixed bug when invalid dates are entered.

Changed two things.
1) Turned trim into one function call for the date.
Used `.replace(/^\s*|\s*$/g, "")` instead of `.replace(/^\s*/, "").replace(/\s*$/, "")`
2) Fixed bug that returned NaN for invalid date values.
To view this bug, open up the demo page and enter "abc" inside the input text box.
Hit the enter key and then click on the input text box. "undefined NaN" should be displayed.


I changed the entered function.

        entered: function() {
          var date = self.parseDate($input.val().replace(/^\s*|\s*$/g, ''));
		  var isValidDate = (new Date(date)).valueOf().toString() !== "NaN";
          if (date == null || !isValidDate) { return; }
          $container.empty().append(self.buildMonth(date)).find(daySelector).eq(date.getDate()-1).click();
        },