Calendar xcal = (Calendar) x; Calendar ycal = (Calendar) y; if ( xcal.before(ycal) ) return -1; if ( xcal.after(ycal) ) return 1; return 0;