{"size": 656, "ext": "js", "max_stars_repo_path": "demo/www/app/datePicker/datePicker.ctrl.js", "max_stars_repo_name": "havefive/ng-cordova-demo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "demo/www/app/datePicker/datePicker.ctrl.js", "max_issues_repo_name": "havefive/ng-cordova-demo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "demo/www/app/datePicker/datePicker.ctrl.js", "max_forks_repo_name": "havefive/ng-cordova-demo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.2941176471, "max_line_length": 71, "alphanum_fraction": 0.5350609756}
angular.module('demo.datePicker.ctrl', [])

  .controller('DatePickerCtrl', function ($scope, $cordovaDatePicker) {

    var options,
        dateType,
        msg = 'not picked yet',
        handleDatePicker = function (date) {
          $scope.data[dateType] = date;
          $scope.$apply();
        };

    $scope.data = {
      date: msg,
      time: msg
    };

    $scope.pick = function (type) {
      options = {
        date: new Date(),
        mode: type
      };
      dateType = type;
      document.addEventListener("deviceready", function () {

        $cordovaDatePicker.show(options, handleDatePicker);

      }, false);


    };

  });
