javascript to show error message if startdate is equal to enddate

This is my code: (but it is not giving my requirement, it is selecting equal dates in both the datepickers)
i need to select the date in endDateField which is greaterthan and not equal to startDateField, it should restrict to select the same dates in both the startDateField and endDateField

var onKeyUp = function () {
var me = this,
v = me.getValue(),

if (me.startDateField) {
field = Ext.getCmp(me.startDateField);
me.dateRangeMax = v;
} else if (me.endDateField) {
field = Ext.getCmp(me.endDateField);
me.dateRangeMin = v;