<commit_before>require('./core');
require('./controller');
require('./templates');
require('./views');

IRC.MessagesView.appendTo('#messages');
IRC.DaysView.appendTo('#days');

IRC.set('daysController', IRC.DaysController.create());
IRC.set('messagesController', IRC.MessagesController.create());

IRC.set('dataSource', Ember.Object.create({

    loadDay: function(day) {
        IRC.messagesController.clear();
        var from = day || IRC.createDateTime();
        var to = from.advance({
            day: 1
        });
        $.couch.db('irc').view('irc/messages', {
            success: function(data) {
                if (data && data.rows && data.rows.length > 0) {
                    data.rows.forEach(function(row) {
                        IRC.messagesController.addMessage(row.doc);
                    });
                }
            },
            include_docs: true,
            reduce: false,
            startkey: IRC.getDateArray(from, 'year', 'month', 'day'),
            endkey: IRC.getDateArray(to, 'year', 'month', 'day')
        });
    }

}));
IRC.dataSource.loadDay(IRC.createDateTime());

$.couch.db('irc').view('irc/messages', {
    success: function(data) {
        if (data && data.rows && data.rows.length > 0) {
            data.rows.forEach(function(doc) {
                var key = doc.key;
                var date = Ember.DateTime.create({
                    year: key[0],
                    month: key[1],
                    day: key[2]
                });
                IRC.daysController.addDay({
                    date: date,
                    count: doc.value
                });
            });
        }
    },
    group_level: 3
});<commit_msg>fix broken date range creation. now only a date without the time is used<commit_after>require('./core');
require('./controller');
require('./templates');
require('./views');

IRC.MessagesView.appendTo('#messages');
IRC.DaysView.appendTo('#days');

IRC.set('daysController', IRC.DaysController.create());
IRC.set('messagesController', IRC.MessagesController.create());

IRC.set('dataSource', Ember.Object.create({

    loadDay: function(day) {
        IRC.messagesController.clear();
        var from = day || IRC.createDateTime();
        var to = from.advance({
            day: 1
        });
        $.couch.db('irc').view('irc/messages', {
            success: function(data) {
                if (data && data.rows && data.rows.length > 0) {
                    data.rows.forEach(function(row) {
                        IRC.messagesController.addMessage(row.doc);
                    });
                }
            },
            include_docs: true,
            reduce: false,
            startkey: IRC.getDateArray(from, 'year', 'month', 'day'),
            endkey: IRC.getDateArray(to, 'year', 'month', 'day')
        });
    }

}));
IRC.dataSource.loadDay(IRC.createDateTime().adjust({
    hour: 0,
    timezone: 0
}));

$.couch.db('irc').view('irc/messages', {
    success: function(data) {
        if (data && data.rows && data.rows.length > 0) {
            data.rows.forEach(function(doc) {
                var key = doc.key;
                var date = Ember.DateTime.create().adjust({
                    year: key[0],
                    month: key[1],
                    day: key[2],
                    hour: 0,
                    timezone: 0
                });
                IRC.daysController.addDay({
                    date: date,
                    count: doc.value
                });
            });
        }
    },
    group_level: 3
});
{'fraction_non_alphanumeric': 0.15793895267432093, 'fraction_numerical': 0.00504060487258471, 'mean_word_length': 1.638109305760709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5866192', 'n_tokens_mistral': 1052, 'n_tokens_neox': 983, 'n_words': 175}