function parseDateString(dateString) {
        if (typeof(dateString) === 'undefined' || dateString === '') {
          return null;
        }
        var parts = dateString.split('-');
        if (parts.length !== 3) {
          return null;
        }
        var year = parseInt(parts[0], 10);
        var month = parseInt(parts[1], 10);
        var day = parseInt(parts[2], 10);

        if (month < 1 || year < 1 || day < 1) {
          return null;
        }
        return new Date(year, (month - 1), day);
      }
@ngdoc directive
 @name ui.grid.edit.directive:input
 @element input
 @restrict E

 @description directive to provide binding between input[date] value and ng-model for angular 1.2
 It is similar to input[date] directive of angular 1.3

 Supported date format for input is 'yyyy-MM-dd'
 The directive will set the $valid property of input element and the enclosing form to false if
 model is invalid date or value of input is entered wrong.