function formatMoment(m, format) {
        var i = 5;

        function replaceLongDateFormatTokens(input) {
            return m.lang().longDateFormat(input) || input;
        }

        while (i-- && localFormattingTokens.test(format)) {
            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
        }

        if (!formatFunctions[format]) {
            formatFunctions[format] = makeFormatFunction(format);
        }

        return formatFunctions[format](m);
    }
function formatMoment(m, format) {
        var i = 5;

        function replaceLongDateFormatTokens(input) {
            return m.lang().longDateFormat(input) || input;
        }

        while (i-- && localFormattingTokens.test(format)) {
            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
        }

        if (!formatFunctions[format]) {
            formatFunctions[format] = makeFormatFunction(format);
        }

        return formatFunctions[format](m);
    }
function formatMoment ( m , format ) { var i = 5 ; function replaceLongDateFormatTokens ( input ) { return m . lang ( ) . longDateFormat ( input ) || input ; } while ( i -- && localFormattingTokens . test ( format ) ) { format = format . replace ( localFormattingTokens , replaceLongDateFormatTokens ) ; } if ( ! formatFunctions [ format ] ) { formatFunctions [ format ] = makeFormatFunction ( format ) ; } return formatFunctions [ format ] ( m ) ; }
format date using native date object
format date using native date object