<commit_before>/* ========================================
 * IVLE WaNDER! - Helpers
 * 
 * Author: <NAME>
 * Last Edit: 21/Jul/2012 10:13 PM
 * ======================================== */

define(function(require, exports) {

    "use strict";
    /*jshint browser:true, jquery:true, laxcomma:true, maxerr:50 */

    // return current academic year and semester
    exports.getSemester = function() {
        var acadYear, semester
        , today = new Date()
        , year = today.getFullYear()
        , month = today.getMonth(); // month is 0 ~ 11

        if (month < 6) { // less than July (Month 6)
            acadYear = (year - 1) + "/" + year;
            semester = 2;
        } else {
            acadYear = year + "/" + (year + 1);
            semester = 1;
        }

        return {
            acadYear : acadYear
          , semester : semester
        };
    };

});<commit_msg>improve semester calculation<commit_after>/* ========================================
 * IVLE WaNDER! - Helpers
 * 
 * Author: <NAME>
 * Last Edit: 21/Jul/2012 10:13 PM
 * ======================================== */

define(function(require, exports) {

    "use strict";
    /*jshint browser:true, jquery:true, laxcomma:true, maxerr:50 */

    // return current academic year and semester
    exports.getSemester = function() {
        var acadYear, semester
        , today = new Date()
        , year = today.getFullYear()
        , month = today.getMonth(); // month is 0 ~ 11

        // month between Dec (11) - July (6)
        if (month <= 6 || month >= 11) {
            acadYear = (year - 1) + "/" + year;
            semester = 2;
        } else {
            acadYear = year + "/" + (year + 1);
            semester = 1;
        }

        return {
            acadYear : acadYear
          , semester : semester
        };
    };

});
{'fraction_non_alphanumeric': 0.2123510292524377, 'fraction_numerical': 0.024918743228602384, 'mean_word_length': 1.9224683544303798, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '1035879', 'n_tokens_mistral': 600, 'n_tokens_neox': 526, 'n_words': 141}