<commit_before>(function () {
    "use strict";

    angular.module('orange')
        .directive('datefield', datefield);


    datefield.$inject = ['$cordovaDatePicker'];

    function datefield($cordovaDatePicker) {
        return {
            scope: {
                'maxDateNow': '='
            },
            require: 'ngModel',
            link: function (scope, elem, attrs, ngModel) {

                if (ionic.Platform.isWebView()) {
                    // Add readonly attribute to input to not display keyboard on iOS devices
                    elem.addClass('not-readonly');
                    elem.attr('readonly', true);
                }

                elem.bind('click', function () {
                    if (ionic.Platform.isWebView()) {
                        // Running on device show datepicker
                        var options = {
                            date: ngModel.$viewValue ? new Date(ngModel.$viewValue) : new Date(),
                            mode: 'date',
                            allowOldDates: true,
                            allowFutureDates: true,
                            androidTheme: $cordovaDatePicker.THEME_DEVICE_DEFAULT_DARK
                        };
                        if (scope.maxDateNow) {
                            options['maxDate'] = device.platform === 'Android' ? Date.now() : new Date();
                        }
                        $cordovaDatePicker.show(options).then(function (date) {
                            var newValue = date.toJSON().slice(0, 10);
                            //alert(newDate);
                            ngModel.$setViewValue(newValue);
                            elem.val(newValue);
                        });
                    } else {<commit_msg>Change to allow the date picker to move past the current date.<commit_after>(function () {
    "use strict";

    angular.module('orange')
        .directive('datefield', datefield);


    datefield.$inject = ['$cordovaDatePicker'];

    function datefield($cordovaDatePicker) {
        return {
            scope: {
//allow dates in the future as per request
//                'maxDateNow': '='
            },
            require: 'ngModel',
            link: function (scope, elem, attrs, ngModel) {

                if (ionic.Platform.isWebView()) {
                    // Add readonly attribute to input to not display keyboard on iOS devices
                    elem.addClass('not-readonly');
                    elem.attr('readonly', true);
                }

                elem.bind('click', function () {
                    if (ionic.Platform.isWebView()) {
                        // Running on device show datepicker
                        var options = {
                            date: ngModel.$viewValue ? new Date(ngModel.$viewValue) : new Date(),
                            mode: 'date',
                            allowOldDates: true,
                            allowFutureDates: true,
                            androidTheme: $cordovaDatePicker.THEME_DEVICE_DEFAULT_DARK
                        };
                        if (scope.maxDateNow) {
                            options['maxDate'] = device.platform === 'Android' ? Date.now() : new Date();
                        }
                        $cordovaDatePicker.show(options).then(function (date) {
                            var newValue = date.toJSON().slice(0, 10);
                            //alert(newDate);
                            ngModel.$setViewValue(newValue);
                            elem.val(newValue);
                        });
                    } else {
{'fraction_non_alphanumeric': 0.10357142857142858, 'fraction_numerical': 0.0016483516483516484, 'mean_word_length': 1.1379917792131533, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2550101', 'n_tokens_mistral': 862, 'n_tokens_neox': 805, 'n_words': 181}