Parceling js

Asked

Viewed 121 times

0

Well created a system of installment of accounts... would like to know how to filter...

[{"tipo":0,"classe":"Saída","nome":"a 1/2","tag":"a","categoria":"Carro","cor":"SkyBlue","data":"2-2016","pg":"1"},{"tipo":0,"classe":"Saída","nome":"a 2/2","tag":"a","categoria":"Carro","cor":"SkyBlue","data":"3-2016","pg":"0"},{"tipo":0,"classe":"Saída","nome":"a2 1/3","tag":"a2","categoria":"Carro","cor":"SkyBlue","data":"2-2016","pg":"0"},{"tipo":0,"classe":"Saída","nome":"a2 2/3","tag":"a2","categoria":"Carro","cor":"SkyBlue","data":"3-2016","pg":"0"},{"tipo":0,"classe":"Saída","nome":"a2 3/3","tag":"a2","categoria":"Carro","cor":"SkyBlue","data":"4-2016","pg":"0"}]

this and the table with all installments that are registered at the time...

e.g. we are in the month 4-2016 filter the late and the current month only... and put a late notice on the late accounts

1 answer

1

function checarDatas(data_parcelamento,data_final) {
    var data_1 = new Date(data_parcelamento);
    var data_2 = new Date(data_final);
    if (data_1 < data_2) {
        console.log('atrasada');
    } else if (data_1 > data_2) {
        console.log('adiantada');
    } else {
        console.log('do mes');
    }
}

I got it like this :D

  • And what you’re calling that function?

  • cheDatas("13-02-2016","13-03-2016"); in javascript

  • But that’s not the format you have... JSON has "data":"2-2016"

  • yes more that and an object I can create it right there under console.log / that 2-2016 and the date I ended up formatting it correctly it was missing the day...

  • OK, +1, I’ll give you another idea later too.

  • blz really changes the way you think?

  • I was thinking something like https://jsfiddle.net/twpqq1yo/

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.