source/js/date/TL.Date.js
function(scale) {
        var d = new Date(this.data.date_obj.getTime());
        for (var i = 0; i < TL.Date.SCALES.length; i++) {
             // for JS dates, we iteratively apply flooring functions
            TL.Date.SCALES[i][2](d);
            if (TL.Date.SCALES[i][0] == scale) return new TL.Date(d);
        };

        throw new TL.Error("invalid_scale_err", scale);
    }
function(scale) {
        var d = new Date(this.data.date_obj.getTime());
        for (var i = 0; i < TL.Date.SCALES.length; i++) {
             // for JS dates, we iteratively apply flooring functions
            TL.Date.SCALES[i][2](d);
            if (TL.Date.SCALES[i][0] == scale) return new TL.Date(d);
        };

        throw new TL.Error("invalid_scale_err", scale);
    }
function ( scale ) { var d = new Date ( this . data . date_obj . getTime ( ) ) ; for ( var i = 0 ; i < TL . Date . SCALES . length ; i ++ ) { // for JS dates, we iteratively apply flooring functions TL . Date . SCALES [ i ] [ 2 ] ( d ) ; if ( TL . Date . SCALES [ i ] [ 0 ] == scale ) return new TL . Date ( d ) ; } ; throw new TL . Error ( "invalid_scale_err" , scale ) ; }
Return a new TL.Date which has been 'floored' at the given scale. @scale = string value from TL.Date.SCALES
Return a new TL . Date which has been floored at the given scale .