<commit_before>import AppointmentIndexController from 'hospitalrun/appointments/index/controller';
export default AppointmentIndexController.extend({
    startingDate: null,
    _setup: function() {    
        this.set('startingDate', new Date());
    }.on('init'),
    
    matchingAppointments: function() {
        var arrangedContent = this.get('arrangedContent'),
            startingDate = moment(this.getWithDefault('startingDate', new Date()));
        return arrangedContent.filter(function (appointment) {
            var endDate = moment(appointment.get('endDate')),
                startDate = moment(appointment.get('startDate'));
            return startingDate.isSame(endDate, 'day') || startingDate.isSame(startDate, 'day') || endDate.isAfter(startingDate, 'day') || startDate.isAfter(startingDate, 'day');
        });
    }.property('content.@each', 'startingDate'),
    
});<commit_msg>Fixed paging on appointment search<commit_after>import AppointmentIndexController from 'hospitalrun/appointments/index/controller';
export default AppointmentIndexController.extend({
    startingDate: null,
    _setup: function() {    
        this.set('startingDate', new Date());
    }.on('init'),
    
    matchingAppointments: function() {
        var arrangedContent = this.get('arrangedContent'),
            startingDate = moment(this.getWithDefault('startingDate', new Date()));
        return arrangedContent.filter(function (appointment) {
            var endDate = moment(appointment.get('endDate')),
                startDate = moment(appointment.get('startDate'));
            return startingDate.isSame(endDate, 'day') || startingDate.isSame(startDate, 'day') || endDate.isAfter(startingDate, 'day') || startDate.isAfter(startingDate, 'day');
        });
    }.property('content.@each', 'startingDate', 'arrangedContent.@each'),
    
});
{'fraction_non_alphanumeric': 0.14170258620689655, 'fraction_numerical': 0.0, 'mean_word_length': 3.8233766233766233, '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': '7042376', 'n_tokens_mistral': 508, 'n_tokens_neox': 489, 'n_words': 91}