Get date by url (string not was recognized datetime)

0

I'm passing an initial and final date per parameter (depending on the image), as you can see the bars on the localhost (/) I'm passing% 20 and graph generation usually occurs, however on the server you're reporting error 500 and when inspecting I see you have the message "string was not recognized datetime". What can be happening since localhost works and the server does not?

        function urldecode(str) {
        return decodeURIComponent((str + '').replace(/\+/g, '%20'));
    }

Here when loading page:

$(window).on('load', function () {
        var data = getParameterByName('data');
        var start = urldecode(getParameterByName('dataInicio'));
        var end = urldecode(getParameterByName('dataFinal'));

        DrawonLoad(start, end, "bottom", 300, "center", 10, data);
        buscaAtosPraticados();
        DrawonLoad2(start, end, "bottom", 300, "center", 10, data);
        buscaCertidoes();
        DrawonLoad3(start, end, "bottom", 300, "center", 10, data);
        buscaBalcaoCRT();
    });

Here's where I call ajax:

function DrawonLoad(dataInicio, dataFinal, posicaoLegenda, tamanho, alinhamento, tamanhoFonte, data) {
        $.ajax({
            type: 'GET',
            url: '/Home/FiltroData?dataInicio=' + urldecode(dataInicio) + '&dataFinal=' + urldecode(dataFinal) + '&data=' + data,
            success: function (chartsdata) {
    
asked by anonymous 24.01.2018 / 21:26

1 answer

0

So, you did not need any of this above, it was just that the server was in English. So I added in the project (webconfig):

 <globalization culture="pt-BR" uiCulture="pt-BR" />
    
25.01.2018 / 13:05