In these two my alert I have two dates, the first date is the date that is taken from my datetime control of devexpress. The second I created a variable and concatenei with get date, month and year.
I'm having trouble comparing what I concatenated with the date of the control because they are in different formats. How to format the date in JavaScript to compare with that first date of the image?
My code:
function ValidaData(controleDataInicio, controleDataFinal) {
var date = new Date();
date = (date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear() + ' 00:00:00');
if (controleDataInicio.GetDate() < date) {
alert(RetornaInternacionalizacao('AlertaData2'));
controleDataInicio.SetValue(null);
}
}