-1
I’m trying to use Moment.js but it’s bone, see?!!!
I have 2 fields that return the PHP date in the dd/mm/yyyy format. I want to show in a third field the difference between these dates. For example: 09/25/2018 and 09/30/2018 the answer has to be 5 days. Obviously in PHP I already did, however if the user changes a field of these update in the third.
In the same example above, if you go from 25/09/2018 to 26/09/2018 auto update in the third field.
I made a bagasse fiddle: http://jsfiddle.net/becw281u/
A good start would be to take a closer look at the documentation, the date you are passing to the function Moment() is not correct. https://momentjs.com/docs/#/Parsing/
– sant0will
I appreciate the comment, but I looked at the documentation and I didn’t understand much. As I said, I already have the date in that format and I realized that I needed to change its format so that Moment.js understood, but I don’t know how to do it...
– Gustavo
It is always good to mark an answer as accepted when it solved your problem. See how in https://i.stack.Imgur.com/jx7Ts.png and why in https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-resposta/1079#1079
– user60252
I still have a low reputation, I can’t score. It’s not bad will, so I posted the thanks.
– Gustavo