Changed category to NSCalendar and made the same as iOS function