Using format like this works in moment.js
function test {
return "DD-MM-YY"
}
but changing to "DD-MM-YY"
doesn't work anymore. Does anyone know why?
I'm trying to compare 2 dates:
function test {
return "DD-MM-YY"
}
var monthMoment = moment().add(1, 'months');
var currentVal = moment($('#fromtextbox').val(), test(), true);
if (currentVal.isAfter(monthMoment)) {
return curentVal;
}
return monthMoment;
You can use a simple format
:
var monthMoment = moment().add(1, 'months').format("DD-MM-YYYY");
var currentVal= moment($('#fromtextbox').val(), test(), true).format("DD-MM-YYYY");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.