Added gregorian calendar and improved custom calendar implementation.