fix undo method

fix undo method
added try catch in getCalendarDateStart/end